@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Oranienbaum&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Oranienbaum&display=swap');

/* ======================
   1. Reset / Base
   ====================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
	font-size: 100%;
}

h1 {
	font-family: 'Oranienbaum', system-ui;
	font-size: 1.75rem;
	font-weight: 600;
	color: rgb(65, 75, 85);
	border-bottom: 1px solid rgb(65, 75, 85);
	padding: 4px;
}

h2 {
	font-family: 'Inter', sans-serif;
	font-size: 1.5rem;
	font-weight: 600;
	color: rgb(255, 255, 255);
}

h3,
time {
	font-family: 'Inter', sans-serif;
	font-size: 1.3rem;
	font-weight: 700;
	color: rgb(255, 255, 255);
}

p {
	font-family: 'Oranienbaum', serif;
	font-size: 1.25rem;
	color: rgb(255, 255, 255);
}

a {text-decoration: none;}

label,
output {
	font-family: 'Inter', sans-serif;
	font-size: 1rem;
	font-weight: 600;
	color: rgb(255, 255, 255);
}

@media screen and (min-width: 1000px) {

	h2 {font-size: 1.75rem;}
	
	h3,
	time {font-size: 1.5rem;}

	p {font-size: 1.4rem;}

	label,
	output,
	button {font-size: 1.25rem;}
}



/* ======================
   Header and Nav
   ====================== */
header {display: contents;}

.nav-box {display: none;}

.headline {
	grid-area: 1/1/2/end;
	display: flex;
	justify-content: center;
	align-items: center;
	background-color: rgb(200, 200, 200);
	border-bottom: 2px solid rgb(130, 130, 130);
	position: sticky;
	top: 0;
	z-index: 5;
}

.burger-button-container {
	grid-area: 1/3/2/4;
	display: flex;
	justify-content: center;
	align-items: center;
	position: sticky;
	top: 0;
	z-index: 5;
}

.burger-button {
	background: transparent;
	border: none;
	color: rgb(65, 75, 85);
	cursor: pointer;
	font-size: 24px;
}

#nav-mobile {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 64px;
	height: 0%;
	width: 100%;
	position: fixed;
	z-index: 3;
	top: 32px;
	left: 0;
	background-color: rgb(200, 200, 200);
	overflow-y: hidden;
	transition: 0.5s;
}

#nav-mobile a {
	font-family: 'Inter', sans-serif;
	font-size: 1.75rem;
	font-weight: 700;
	text-decoration: none;
	color: rgb(65, 75, 85);
	transition: 0.3s;
}

#nav-mobile a:hover {color: rgb(255, 255, 255);}

@media screen and (min-width: 1000px) {

	.header {
		grid-area: 1/1/2/2;
		background: rgb(195, 195, 195);
		display: flex;
		align-items: center;
		z-index: 5;
		border-bottom: 2px solid rgb(133, 133, 133);
		position: sticky;
		top: 0;
  	}

	.headline {
		border-bottom: none;
		background: transparent;
	}

	.nav-box {
		flex: 1;
		display: flex;
		justify-content: space-evenly;
		align-items: center;
	}

	.nav-box a {
		font-family: 'Inter', sans-serif;
		font-size: 1.25rem;
		font-weight: 600;	
		text-decoration: none;
		color: rgb(65, 75, 85);
	}

	/* === BEGIN CC-BY-4.0 CODE ============================
	* Author: Angelos Chalaris
	* Source: https://github.com/Chalarangelo/30-seconds-of-code/blob/master/content/snippets/css/s/hover-underline-animation.md
	* License: CC BY 4.0 — https://creativecommons.org/licenses/by/4.0/
	* Changes: modified class names and colors
	* =================================================== */

	.highlight-text {position: relative;}

	.highlight-text::after {
		content: '';
		position: absolute;
		width: 100%;
		transform: scaleX(0);
		height: 2px;
		bottom: 0;
		left: 0;
		background-color: rgb(65, 75, 85);
		transition: transform 0.25s ease-out;
		transform-origin: bottom right;
	}

	.highlight-text:hover::after {
		transform: scaleX(1);
		transform-origin: bottom left;
	}

	/* === END CC-BY-4.0 CODE ============================== */

	.burger-button-container,
	.burger-button,
	#nav-mobile {display: none;}
}



/* ======================
   Main grid sections
   ====================== */
.grid-container {
	display: grid;
	grid-template-columns: 1fr 5fr 1fr;
	grid-template-rows: 64px 1fr;
	width: 100%;
	min-height: 100vh;
}

.grid-item-main {
	grid-area: 2/1/3/4;
	background-color: rgb(70, 70, 70);
	background-size: cover;
	background-position: center;
	background-attachment: fixed;
	background-blend-mode: color-burn;
	box-shadow: inset 0 0 12px 4px black; 
}

@media screen and (min-width: 1000px) {
	.grid-container {grid-template-columns: 1fr;}
}



/* ======================
   Home Page
   ====================== */
#home-page {
	display: grid;
	grid-template-columns: 1fr 5fr 1fr;
	grid-template-rows: 64px 1fr;
	width: 100vw;
	height: 100vh;
}

#gallery-container {
	grid-area: 2/1/5/4;
	background: rgb(0, 0, 0);
	overflow: hidden;
}

.gallery-item {
	position: relative;
	height: 100%;
	width: 100%;
	animation-name: fade;
	animation-duration: 3s;
}

@keyframes fade {
	from {opacity: .4}
	to {opacity: 1}
}

.gallery-item-img {
	object-fit: cover;
	width: 100%;
	height: 100%;
	background-color: rgb(150, 150, 150);
	box-shadow: inset 0 0 24px 8px #000000;
}

.gallery-page-link {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	text-align: center;
	color: white;
	font-size: 3rem;
	text-shadow: 0 0 1.25rem black, 0 0 1.25rem black, 0 0 1.25rem black, 0 0 1.25rem black;
}

.gallery-page-link:hover {
	text-decoration-line: underline;
	text-decoration-thickness: 3px;
	text-underline-offset: 7px;
}

@media screen and (min-width: 1000px) {
	#home-page {grid-template-columns: 1fr;}
	.gallery-page-link {font-size: 4rem;}
}



/* ======================
   History Page
   ====================== */
#history-page-main {
	display: grid;
	grid-template-columns: 48px 11fr;
	grid-template-rows: repeat(9, 1fr 0.5fr 1fr);
  	background-image: url(../Images/sun-earth-moon-geometry.png);
	padding-right: 32px;
	row-gap: 16px;
}

#ruler {
	display: flex;
	justify-content: center;
	grid-area: 1/1/28/2;
}

#ruler > div {
	background-color: rgb(255, 255, 255);
	width: 3px;
}

.ruler-dot {
	display: flex;
	justify-content: center;
	align-items: center;
}

.ruler-dot > div {
	width: 15px;
	height: 15px;
	border-radius: 50%;
	background: rgb(255, 128, 0);
	border: 3px solid rgb(106, 66, 21);
}

.timeline-item {
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.timeline-date-title {
	background: -webkit-linear-gradient(rgb(255, 255, 255), rgb(255, 128, 0));
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
}

.timeline-desc {
	display: flex;
	align-items: center;
	padding: 8px;
	background: rgba(0, 0, 0, 0.623);    
	box-shadow: 0 0 8px 4px rgb(0, 0, 0);
	border-radius: 8px; 
}

#ruler-dot-1 {grid-area: 2/1/3/2;}
#timeline-item-1 {grid-area: 2/2/3/3;}
#timeline-desc-1 {grid-area: 3/2/4/3;}

#ruler-dot-2 {grid-area: 5/1/6/2;}
#timeline-item-2 {grid-area: 5/2/6/3;}
#timeline-desc-2 {grid-area: 6/2/7/3;}

#ruler-dot-3 {grid-area: 8/1/9/2;}
#timeline-item-3 {grid-area: 8/2/9/3;}
#timeline-desc-3 {grid-area: 9/2/10/3;}

#ruler-dot-4 {grid-area: 11/1/12/2;}
#timeline-item-4 {grid-area: 11/2/12/3;}
#timeline-desc-4 {grid-area: 12/2/13/2;}

#ruler-dot-5 {grid-area: 14/1/15/2;}
#timeline-item-5 {grid-area: 14/2/15/3;}
#timeline-desc-5 {grid-area: 15/2/16/3;}

#ruler-dot-6 {grid-area: 17/1/18/2;}
#timeline-item-6 {grid-area: 17/2/18/3;}
#timeline-desc-6 {grid-area: 18/2/19/3;}

#ruler-dot-7 {grid-area: 20/1/21/2;}
#timeline-item-7 {grid-area: 20/2/21/3;}
#timeline-desc-7 {grid-area: 21/2/22/3;}

#ruler-dot-8 {grid-area: 23/1/24/2;}
#timeline-item-8 {grid-area: 23/2/24/3;}
#timeline-desc-8 {grid-area: 24/2/25/3;}

#timeline-desc-9 {
	grid-area: 26/2/27/3;
	text-shadow: 0 0 4px rgb(0, 0, 0);
}

@media screen and (min-width: 601px) {

	#history-page-main {
		grid-template-columns: 1fr 3fr 8fr;
		grid-template-rows: repeat(9, 2.5fr 2fr) 1.5fr;
		row-gap: 0;
		column-gap: 8px;
	}

	#ruler {grid-area: 1/1/end/2;}

	#ruler-dot-1 {grid-area: 2/1/3/2;}
	#timeline-item-1 {grid-area: 2/2/3/3;}
	#timeline-desc-1 {grid-area: 2/3/3/4;}	

	#ruler-dot-2 {grid-area: 4/1/5/2;}
	#timeline-item-2 {grid-area: 4/2/5/3;}
	#timeline-desc-2 {grid-area: 4/3/5/4;}

	#ruler-dot-3 {grid-area: 6/1/7/2;}
	#timeline-item-3 {grid-area: 6/2/7/3;}
	#timeline-desc-3 {grid-area: 6/3/7/4;}

	#ruler-dot-4 {grid-area: 8/1/9/2;}
	#timeline-item-4 {grid-area: 8/2/9/3;}
	#timeline-desc-4 {grid-area: 8/3/9/4;}

	#ruler-dot-5 {grid-area: 10/1/11/2;}
	#timeline-item-5 {grid-area: 10/2/11/3;}
	#timeline-desc-5 {grid-area: 10/3/11/4;}

	#ruler-dot-6 {grid-area: 12/1/13/2;}
	#timeline-item-6 {grid-area: 12/2/13/3;}
	#timeline-desc-6 {grid-area: 12/3/13/4;}

	#ruler-dot-7 {grid-area: 14/1/15/2;}
	#timeline-item-7 {grid-area: 14/2/15/3;}
	#timeline-desc-7 {grid-area: 14/3/15/4;}

	#ruler-dot-8 {grid-area: 16/1/17/2;}
	#timeline-item-8 {grid-area: 16/2/17/3;}
	#timeline-desc-8 {grid-area: 16/3/17/4;}

	#timeline-desc-9  {grid-area: 18/2/19/4;}
}

@media screen and (min-width: 1000px) {
	
  	#history-page-main {
		grid-template-columns: 20fr 1fr 20fr;
		grid-template-rows: repeat(9, 2.5fr 2fr) 1fr;
		padding: 0 32px;
	}

	#ruler {grid-area: 1/2/end/3;}

	#timeline-item-1,
	#timeline-item-3,
	#timeline-item-5,
	#timeline-item-7 {align-items: flex-end;}

	#timeline-desc-2,
	#timeline-desc-4,
	#timeline-desc-6,
	#timeline-desc-8 {text-align: right;}

	#timeline-item-1 {grid-area: 2/1/3/2;}
	#ruler-dot-1 {grid-area: 2/2/3/3;}
	#timeline-desc-1 {grid-area: 2/3/3/4;}

	#timeline-item-2 {grid-area: 4/3/5/4;}
	#ruler-dot-2 {grid-area: 4/2/5/3;}
	#timeline-desc-2 {grid-area: 4/1/5/2;}

	#timeline-item-3 {grid-area: 6/1/7/2;}
	#ruler-dot-3 {grid-area: 6/2/7/3;}
	#timeline-desc-3 {grid-area: 6/3/7/4;}

	#timeline-item-4 {grid-area: 8/3/9/4;}
	#ruler-dot-4 {grid-area: 8/2/9/3;}
	#timeline-desc-4 {grid-area: 8/1/9/2;}

	#timeline-item-5 {grid-area: 10/1/11/2;}
	#ruler-dot-5 {grid-area: 10/2/11/3;}
	#timeline-desc-5 {grid-area: 10/3/11/4;}

	#timeline-item-6 {grid-area: 12/3/13/4;}
	#ruler-dot-6 {grid-area: 12/2/13/3;}
	#timeline-desc-6 {grid-area: 12/1/13/2;}

	#timeline-item-7 {grid-area: 14/1/15/2;}
	#ruler-dot-7 {grid-area: 14/2/15/3;}
	#timeline-desc-7 {grid-area: 14/3/15/4;}
	
	#timeline-item-8 {grid-area: 16/3/17/4;}
	#ruler-dot-8 {grid-area: 16/2/17/3;}
	#timeline-desc-8 {grid-area: 16/1/17/2;}

	#timeline-desc-9  {grid-area: 18/3/19/4;}
}



/* ======================
   Gravity Page
   ====================== */
#gravity-page-main{  
    display: grid;
	grid-template-columns: auto;
	grid-template-rows: auto auto auto auto ;
    padding: 16px;
	gap: 48px;
}

#gravity-text-1,
#gravity-formula-1,
#apple-tree {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

#gravity-text-1{grid-row: 2/3;}

#picture-Newton{grid-row: 1/2;}

#gravity-formula-1{grid-row: 3/4;}

#apple-tree1{grid-row: 4/5;}

.tree-wrapper{
	position: relative;
	display: flex;
	justify-content: center;
	width: min(80vw, 640px);
	margin: 0 auto;
	--ground: 80%;
}

.tree{
	width: 80%;
	height: auto;
	filter: brightness(0.8) contrast(1.1);
}

.apple{
	position: absolute;
	width: 14vw;
	max-width: 100px;
	min-width: 40px;
	top: 16%;
	left: 56%;
	cursor: pointer;
	filter: brightness(0.8) contrast(1.1);
}

.tree-wrapper .apple.fall{
    animation: appleDrop 1.1s ease-in forwards;
}

@keyframes appleDrop{
    to { top: var(--ground); }
}

@media screen and (min-width: 800px){

	#gravity-page-main{
		grid-template-columns: 1fr 1fr;
		grid-template-rows: auto auto auto;
	}

	#gravity-text-1{grid-area: 1/1/2/2;}

	#picture-Newton{grid-area: 1/2/2/3;}

	#gravity-formula-1{grid-area: 2/1/3/3;}

	#apple-tree1{grid-area: 3/1/4/3;}
}



/* ======================
   Pendulum Page
   ====================== */
#pendulum-page-main {
	display: grid;
	grid-template-columns: 1fr;
	gap: 48px;
	padding: 16px;
}

.cross-page-ref {
	text-decoration: none;
	background: -webkit-linear-gradient(rgb(255, 255, 255), rgb(255, 128, 0));
	background-clip: text;
	-webkit-text-fill-color: transparent;
}

.cross-page-ref:hover {
	text-decoration: underline;
	background: white;
	background-clip: text;
	-webkit-text-fill-color: white;
}

.pendulum-text,
#pendulum-demo,
.pendulum-controls,
.pendulum-control-group {
	display: flex;
	flex-direction: column;
}

.pendulum-text,
#pendulum-demo,
.pendulum-controls,
.pendulum-control-group {gap: 16px;}

#pendulum-text-1 {grid-area: 1/1/2/2;}

#pendulum-text-2 {grid-area: 2/1/3/2;}

#pendulum-text-3 {grid-area: 4/1/5/2;}

#pendulum-demo {grid-area: 3/1/4/2;}

#pendulum-container {
	margin: 0 auto;
	width: 200px;
	border: 2px solid white;
	border-radius: 50%;
	box-shadow: 0 0 8px 4px black;
}

input[type="range"] {
	height: 8px;
	cursor: pointer;
}

.value-display {text-align: center;}

.pendulum-control-button {
    padding: 15px 30px;
    border: none;
	border-radius: 8px;
    cursor: pointer;
    background: rgb(195, 195, 195);
    color: rgb(65, 75, 85);
    transition: background 0.3s;
}

.pendulum-control-button:hover {background: rgb(255, 255, 255);}

#pendulum-svg {
	background-color: rgb(100, 100, 100);
	border-radius: 50%;
}

.pendulum-rod {
    stroke: white;
    stroke-width: 2;
}

.pendulum-weight {
	fill: rgb(65, 75, 85);
    stroke: white;
    stroke-width: 2;
}

.pivot {fill: rgb(255, 255, 255);}

@media screen and (min-width: 700px) {

	#pendulum-page-main {
		grid-template-columns: 1fr 1fr;
		grid-auto-rows: auto;
		gap: 32px;
	}

	#pendulum-text-1 {grid-area: 1/1/2/2;}
	#pendulum-text-2 {grid-area: 1/2/2/3;}
	#pendulum-text-3 {grid-area: 3/1/4/3;}

	#pendulum-demo {display: contents;}

	#pendulum-container {
		grid-area: 2/1/3/2;
		width: 300px;
		height: 300px;
		display: flex;
		align-items: center;
	}

	#pendulum-wrapper {
		display: flex;
		align-items: center;
	}

	.pendulum-controls {
		grid-area: 2/2/3/3;
		width: 90%;
		margin: 0 auto;
		justify-content: center;
	}
}

@media  screen and (min-width: 1000px) {
	
	#pendulum-page-main {
		grid-template-columns: 1fr 1fr 1fr;
		padding: 16px 64px;
	}

	.pendulum-text {display: contents;}

	.pendulum-text-title,
	.pendulum-text-desc-ctn,
	#pendulum-demo,
	#pendulum-container {
		display: flex;
		flex-direction: row;
		align-items: center;
	}

	#pendulum-text-title-1 {grid-area: 1/1/2/2;}
	#pendulum-text-desc-1-ctn {grid-area: 1/2/2/4;}

	#pendulum-text-title-2 {grid-area: 2/1/3/2;}
	#pendulum-text-desc-2-ctn {grid-area: 2/2/3/4;}

	#pendulum-text-title-3 {grid-area: 4/1/5/2;}
	#pendulum-text-desc-3-ctn {grid-area: 4/2/5/4;}

	#pendulum-demo {
		grid-area: 3/1/4/4;
		justify-content: center;
		gap: 32px;
	}

	#pendulum-container {
		width: 400px;
		height: 400px;
	}

	.pendulum-controls {
		justify-content: center;
		width: 40%;
		gap: 32px; 
		margin: 0;
	}
}



/* ======================
   Quiz Page
   ====================== */
#quiz-page-main{
	background-image: url(../Images/math-formulas-sketch-handwritten.svg);
	padding: 16px;
	display: flex;
	justify-content: center;
	align-items: center;
}

.quiz-container {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
}

#quiz-question {align-self: center;}

#answer-buttons {
	align-self: stretch;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.answer-btn {
	background: rgb(255, 255, 255);
	color: rgb(0, 0, 0);
	border: 1px solid rgb(0, 0, 0);
	padding: 12px;
	text-align: left;
	border-radius: 5px;
	cursor: pointer;
	transition: all 0.3s;
}

.answer-btn:hover:not([disabled]){
	background: rgb(0, 0, 0);
	color: rgb(255, 255, 255);
}

.answer-btn:disabled{
  	cursor: no-drop;
}

#next-btn{
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgb(195, 195, 195);
	color: rgb(65, 75, 85);
	width: 150px;
	height: 40px;
	border: none;
	padding: 12px;
	border-radius: 4px;
	cursor: pointer;
	transition: background 0.3s;
}

#next-btn:hover {background-color: rgb(255, 255, 255);}

.correct{background: rgb(160, 240, 160);}

.incorrect{background: rgb(240, 130, 130);}

@media screen and (min-width: 650px) {

	.quiz-container  {
		width: 100%;
		justify-content: center;  
		align-items: center;
		gap: 32px;
	}
	
	#answer-buttons {
		flex-direction: row;
		flex-wrap: wrap;
		align-items: center;
		justify-content: center;
		gap: 32px;
		width: 100%;
	}

	.answer-btn {
		padding: 16px;
		width: 40%;
		text-align: center;
	}
}