/* ============================================================================
   RESET & BASE
   ============================================================================ */

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

html, body {
	width: 100%;
	height: 100%;
}

body {
	background-color: #12100E;
	color: #A09480;
	font-family: 'Vollkorn', serif;
	font-size: clamp(0.95rem, 1.1vw, 1.1rem);
	line-height: 1.75;
	overflow-x: hidden;
}

/* ============================================================================
   TYPOGRAPHY
   ============================================================================ */

h1, h2, h3 {
	font-family: 'Fraunces', serif;
	color: #F0E4D0;
}

.hero-text {
	font-size: clamp(2.5rem, 6vw, 5rem);
	font-weight: 800;
	letter-spacing: -0.02em;
	margin-bottom: 1rem;
	font-variation-settings: "WONK" 1;
}

.subtitle {
	font-family: 'Vollkorn', serif;
	font-size: clamp(0.95rem, 1.1vw, 1.1rem);
	color: #A09480;
	font-weight: 400;
}

.card-title, .bento-title {
	font-family: 'Fraunces', serif;
	font-size: clamp(1.1rem, 1.3vw, 1.3rem);
	font-weight: 600;
	color: #F0E4D0;
	margin-bottom: 0.8rem;
	margin-top: 1rem;
}

.card-text, .bento-text {
	font-family: 'Vollkorn', serif;
	font-size: clamp(0.95rem, 1.1vw, 1.1rem);
	color: #A09480;
	line-height: 1.75;
}

.note-text {
	font-family: 'Kalam', cursive;
	font-size: clamp(0.9rem, 1.1vw, 1.05rem);
	color: #B8A890;
	font-weight: 400;
	line-height: 1.8;
	margin-bottom: 0.5rem;
}

.note-date {
	font-family: 'Courier Prime', monospace;
	font-size: clamp(0.75rem, 0.85vw, 0.85rem);
	color: #8A7A60;
	letter-spacing: 0.02em;
	margin-bottom: 0.5rem;
}

.index-entry {
	font-family: 'Courier Prime', monospace;
	font-size: clamp(0.75rem, 0.85vw, 0.85rem);
	color: #8A7A60;
	letter-spacing: 0.02em;
	line-height: 2.0;
}

.close-text {
	font-family: 'Vollkorn', serif;
	font-size: clamp(0.95rem, 1.1vw, 1.1rem);
	color: #A09480;
	text-align: center;
	margin-bottom: 1.5rem;
}

.close-contact {
	font-family: 'Courier Prime', monospace;
	font-size: clamp(0.75rem, 0.85vw, 0.85rem);
	letter-spacing: 0.02em;
	color: #8A7A60;
}

/* ============================================================================
   DRAWERS & SECTIONS
   ============================================================================ */

.drawer {
	position: relative;
	width: 100%;
	min-height: 100vh;
	padding: 5vh 0;
	background: linear-gradient(135deg, #1E1A16 0%, #2A241E 100%);
	display: flex;
	align-items: center;
	justify-content: center;
}

.drawer-label {
	background-color: #12100E;
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 2rem;
}

.drawer-close {
	min-height: 50vh;
	background-color: #12100E;
	padding: 3rem 2rem;
}

.drawer-content {
	width: 100%;
	max-width: 90vw;
	display: flex;
	flex-direction: column;
	gap: 10vh;
	align-items: center;
}

/* ============================================================================
   CABINET DOOR (DRAWER 0)
   ============================================================================ */

.cabinet-door {
	position: relative;
	width: clamp(300px, 70vw, 900px);
	height: clamp(360px, 60vh, 800px);
	background: linear-gradient(90deg, #3A2E22 0%, #4A3E32 50%, #3A2E22 100%);
	border: 1px solid #5A4A3A;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
	animation: slideUpDoor 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.4s both;
}

@keyframes slideUpDoor {
	from {
		transform: translateY(100vh);
		opacity: 0;
	}
	to {
		transform: translateY(0);
		opacity: 1;
	}
}

.wood-texture {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
}

#woodGrainPattern {
	background: repeating-linear-gradient(
		90deg,
		rgba(58, 46, 34, 0.15) 0px,
		transparent 2px,
		transparent 8px
	);
}

.cabinet-content {
	position: relative;
	z-index: 2;
	text-align: center;
	animation: fadeIn 0.4s ease-out 1s both;
}

@keyframes fadeIn {
	from { opacity: 0; }
	to { opacity: 1; }
}

.cabinet-handle {
	position: absolute;
	bottom: 3rem;
	left: 50%;
	transform: translateX(-50%);
	cursor: pointer;
	z-index: 3;
	animation: handleAppear 0.2s ease-out 1.2s both;
}

@keyframes handleAppear {
	from {
		opacity: 0;
		transform: translateX(-50%) scale(0.8);
	}
	to {
		opacity: 1;
		transform: translateX(-50%) scale(1);
	}
}

.cabinet-handle:hover {
	animation: handleRotate 0.3s ease-out forwards;
}

@keyframes handleRotate {
	from { transform: translateX(-50%) rotate(0deg); }
	to { transform: translateX(-50%) rotate(15deg); }
}

@keyframes handlePulse {
	0%, 100% { transform: translateX(-50%) translateY(0); }
	50% { transform: translateX(-50%) translateY(4px); }
}

body.page-loaded .cabinet-handle {
	animation: handlePulse 0.4s ease-in-out 1.6s both;
}

/* ============================================================================
   SPECIMEN CARDS (DRAWER 1)
   ============================================================================ */

.specimen-card {
	width: clamp(300px, 60vw, 700px);
	padding: 2.5rem;
	background: #2A241E;
	border: 2px solid #8A7A60;
	position: relative;
	animation: slideInCard 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

.specimen-card:nth-child(1) { animation-delay: 2.2s; }
.specimen-card:nth-child(2) { animation-delay: 2.5s; }
.specimen-card:nth-child(3) { animation-delay: 2.8s; }

@keyframes slideInCard {
	from {
		opacity: 0;
		transform: translateY(40px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.specimen-label {
	width: auto;
	height: auto;
	margin-bottom: 1rem;
	opacity: 1;
	transition: transform 0.2s ease-out, filter 0.2s ease-out;
}

.specimen-card:hover .specimen-label {
	transform: translateY(-3px);
	filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.specimen-card:hover {
	border-color: #B8A890;
	box-shadow: inset 0 0 20px rgba(90, 122, 74, 0.05);
}

/* ============================================================================
   BENTO GRID (DRAWER 2)
   ============================================================================ */

.bento-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(clamp(200px, 22vw, 350px), 1fr));
	gap: clamp(1rem, 2vw, 2rem);
	width: 90vw;
	max-width: 1200px;
	padding: 2rem;
}

.bento-cell {
	background: #2A241E;
	border: 2px solid #8A7A60;
	padding: 1.5rem;
	height: auto;
	min-height: 280px;
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	position: relative;
	animation: slideInBento 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
	transition: border-color 0.2s ease-out, box-shadow 0.2s ease-out;
}

@keyframes slideInBento {
	from {
		opacity: 0;
		transform: translateY(30px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.bento-cell:nth-child(1) { animation-delay: 3.2s; }
.bento-cell:nth-child(2) { animation-delay: 3.32s; }
.bento-cell:nth-child(3) { animation-delay: 3.44s; }
.bento-cell:nth-child(4) { animation-delay: 3.56s; }
.bento-cell:nth-child(5) { animation-delay: 3.68s; }
.bento-cell:nth-child(6) { animation-delay: 3.8s; }

.bento-cell:hover {
	border-color: #B8A890;
	box-shadow: inset 0 0 20px rgba(90, 122, 74, 0.05);
}

.bento-title {
	font-size: clamp(1rem, 1.2vw, 1.2rem);
	margin-bottom: 0.8rem;
	position: relative;
}

.bento-title::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 100%;
	pointer-events: none;
}

@keyframes glitch {
	0%, 2%, 98%, 100% {
		transform: translateX(0);
		color: #F0E4D0;
	}
	1%, 99% {
		transform: translateX(2px);
		color: #C4785A;
	}
}

.bento-title {
	animation: glitch 10s ease-in-out infinite;
	animation-delay: var(--glitch-delay, 0s);
}

.bento-cell:nth-child(1) .bento-title { --glitch-delay: 0s; }
.bento-cell:nth-child(2) .bento-title { --glitch-delay: 2s; }
.bento-cell:nth-child(3) .bento-title { --glitch-delay: 4s; }
.bento-cell:nth-child(4) .bento-title { --glitch-delay: 1s; }
.bento-cell:nth-child(5) .bento-title { --glitch-delay: 3s; }
.bento-cell:nth-child(6) .bento-title { --glitch-delay: 5s; }

.bento-text {
	font-size: clamp(0.85rem, 0.95vw, 1rem);
	color: #A09480;
	line-height: 1.6;
}

/* ============================================================================
   FIELD NOTES (DRAWER 3)
   ============================================================================ */

.field-notes {
	position: relative;
	width: 100%;
	max-width: 50vw;
	margin-left: 30%;
	display: flex;
	flex-direction: column;
	gap: 3rem;
}

.field-note {
	position: relative;
	padding-left: 1.5rem;
	padding-top: 2rem;
	padding-bottom: 1.5rem;
	padding-right: 1.5rem;
	border-top: 2px dashed #8A7A60;
	border-top-left-radius: 50% 100%;
	border-top-right-radius: 30% 100%;
	animation: slideInNote 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

@keyframes slideInNote {
	from {
		opacity: 0;
		transform: translateX(-40px);
	}
	to {
		opacity: 1;
		transform: translateX(0);
	}
}

.field-note:nth-child(1) { animation-delay: 4.2s; }
.field-note:nth-child(2) { animation-delay: 4.4s; }
.field-note:nth-child(3) { animation-delay: 4.6s; }
.field-note:nth-child(4) { animation-delay: 4.8s; }

/* ============================================================================
   ARCHIVE INDEX (DRAWER 4)
   ============================================================================ */

.archive-index {
	display: flex;
	flex-direction: column;
	gap: 0;
	width: 90vw;
	max-width: 800px;
	padding: 2rem;
	animation: slideInArchive 0.5s ease-out backwards;
}

@keyframes slideInArchive {
	from {
		opacity: 0;
		transform: translateY(30px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.index-entry {
	animation: fadeInIndex 0.03s ease-out forwards;
}

.index-entry:nth-child(1) { animation-delay: 5.4s; }
.index-entry:nth-child(2) { animation-delay: 5.43s; }
.index-entry:nth-child(3) { animation-delay: 5.46s; }
.index-entry:nth-child(4) { animation-delay: 5.49s; }
.index-entry:nth-child(5) { animation-delay: 5.52s; }
.index-entry:nth-child(6) { animation-delay: 5.55s; }
.index-entry:nth-child(7) { animation-delay: 5.58s; }

@keyframes fadeInIndex {
	from { opacity: 0; }
	to { opacity: 1; }
}

/* ============================================================================
   CLOSE SECTION (DRAWER 5)
   ============================================================================ */

.close-content {
	text-align: center;
	animation: fadeIn 0.5s ease-out 6s both;
}

/* ============================================================================
   SECTION DIVIDERS
   ============================================================================ */

.section-divider {
	width: 100%;
	height: 20px;
	background: transparent;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem 0;
}

.section-divider svg {
	width: 100%;
	height: 100%;
	max-width: 1200px;
}

/* ============================================================================
   SCROLL BEHAVIOR
   ============================================================================ */

html {
	scroll-behavior: smooth;
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 768px) {
	.field-notes {
		margin-left: 5%;
		max-width: 90vw;
	}

	.bento-grid {
		grid-template-columns: 1fr;
	}

	.specimen-card {
		width: 90vw;
	}

	.drawer-content {
		max-width: 95vw;
	}

	.archive-index {
		width: 90vw;
	}
}

/* ============================================================================
   ACCESSIBILITY
   ============================================================================ */

@media (prefers-reduced-motion: reduce) {
	* {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}

/* ============================================================================
   DARK MODE (DEFAULT FOR THIS DESIGN)
   ============================================================================ */

@media (prefers-color-scheme: dark) {
	body {
		background-color: #12100E;
		color: #A09480;
	}
}
