/* ==========================================================================
   05 — HELLO
   ========================================================================== */


.container {
  position: relative;
  display: flex;
  width: 100%;
  height: 300px;
}

.split-bg-left {
  flex: 1;
  background-color: var(--color-text); /* Black */
}

.split-bg-right {
  flex: 1;
  background-color: var(--color-bg); /* White */
}

.inverted-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  font-family: sans-serif;
  font-size: 3rem;
  
  /* Critical rules for inversion */
  color: #ffffff; 
  mix-blend-mode: difference; 
}




/* ==========================================================================
   HELLO — STAGE
   ========================================================================== */

.hello-stage {
	position: relative;

	width: 100%;
	height: 100%;
	
	background: var(--color-text);
	color: var(--color-bg);
	/*
	background: var(--color-bg);
	color: var(--color-text);
	*/
}


/* ==========================================================================
   HELLO — CHAPTER MARKER
   ========================================================================== */

.chapter-hello .chapter-marker {
	grid-column: 1;
	grid-row: 1;

	align-self: center;
}


/* ==========================================================================
   HELLO — CONTENT
   ========================================================================== */
.hello-page-copy {
	display: flex;
	grid-column: 1;
	align-self: start;
	font-family: var(--font-primary);
	margin: 0;
}

.hello-content {
	grid-column: 2;
	grid-row: 1;

	align-self: center;

	display: grid;
	grid-template-columns:
		minmax(0, 1fr)
		minmax(0, 1fr);

	column-gap: clamp(40px, 6vw, 100px);

	width: 100%;
}

.hello-header {
	display: flex;
    flex-direction: column;
    align-items: flex-start;
}
/*
.hello-header h1 {
	margin: 0;

	font-family: var(--font-primary);
	font-size: clamp(4rem, 8vw, 7.5rem);
	font-weight: 700;
	line-height: 0.85;
	letter-spacing: -0.055em;

	color: var(--color-bg);
}
*/

.hello-header-accent {
	color: var(--color-accent);
}


/* ==========================================================================
   HELLO — FORM
   ========================================================================== */

.hello-contact{
	display: flex;
}

.hello-form {
	grid-column: 2;

	display: flex;
	flex-direction: column;
	gap: 28px;

	width: 100%;
}

.hello-field {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.hello-field label {
	font-size: 13px;
	font-weight: 600;

	letter-spacing: 0.04em;
	text-transform: uppercase;

	color: var(--color-muted);
}

.hello-field input,
.hello-field textarea {
	display: block;
	width: 100%;

	padding: 12px 0;

	background-color: transparent;
	border: 0;
	border-bottom: 1px solid var(--color-muted);
	border-radius: 0;
	outline: 0;

	font: inherit;
	color: var(--color-bg);

	appearance: none;
	-webkit-appearance: none;
}

.hello-field textarea {
	resize: vertical;
}

.hello-field input:focus,
.hello-field textarea:focus {
	background-color: transparent;
	border-bottom-color: var(--color-accent);
	outline: 0;
}

.hello-field input:-webkit-autofill:focus,
.hello-field textarea:-webkit-autofill:focus {
	border-bottom-color: var(--color-accent);
}

.hello-field input:-webkit-autofill,
.hello-field input:-webkit-autofill:hover,
.hello-field input:-webkit-autofill:focus,
.hello-field textarea:-webkit-autofill,
.hello-field textarea:-webkit-autofill:hover,
.hello-field textarea:-webkit-autofill:focus {
	-webkit-text-fill-color: var(--color-bg);
	caret-color: var(--color-bg);

	-webkit-box-shadow:
		0 0 0 1000px var(--color-text) inset;

	box-shadow:
		0 0 0 1000px var(--color-text) inset;

	border-bottom: 1px solid var(--color-muted);
}


/* ==========================================================================
   HELLO — HUMAN CHECK
   ========================================================================== */

.hello-human-area {
	position: relative;

	width: 100%;
	height: 150px;

	/*/overflow: hidden;/*/
}

.hello-human-check {
	position: absolute;
	top: 0;
	left: 0;

	display: inline-flex;
	align-items: center;
	gap: 12px;

	padding:
		14px
		16px;

	background: var(--color-text);
	border: 1px solid rgb(255 255 255 / 15%);

	font: inherit;
	color: inherit;

	white-space: nowrap;

	cursor: default;

	transition:
		left 180ms ease,
		top 180ms ease;
}

.hello-human-check:focus {
	outline: 0;
}

.hello-human-check:focus-visible .hello-human-box {
	outline: 2px solid var(--color-disrupt);
	outline-offset: 4px;
}

/* CHECKBOX */

.hello-human-box {
	cursor: pointer;
	position: relative;

	flex: 0 0 auto;

	width: 20px;
	height: 20px;

	border: 2px solid currentColor;
}


/* HUMAN CONFIRMED */

.hello-human-check.is-human {
	cursor: default;
}

.hello-human-check.is-human .hello-human-box {
	background: var(--color-accent);
	border-color: var(--color-accent);
	cursor: default;
}

.hello-human-check.is-human .hello-human-box::after {
	content: "";

	position: absolute;
	top: 2px;
	left: 6px;

	width: 5px;
	height: 10px;

	border:
		solid var(--color-bg);
	border-width:
		0
		2px
		2px
		0;

	transform: rotate(45deg);
}


/* ==========================================================================
   HELLO — SUBMIT
   ========================================================================== */

.hello-submit-stage {
	position: relative;

	width: 160px;
	height: 160px;
}


/* BUTTON */

.hello-submit {
	position: absolute;
	top: 42.5px;
	left: 5px;

	width: 150px;
	height: 75px;

	padding: 0;

	overflow: visible;

	background: var(--color-bg);
	border: 0;
	border-radius: 0;

	font: inherit;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;

	color: var(--color-text);

	cursor: pointer;

	opacity: 1;

	transform-origin: center;

	transition:
		opacity 180ms ease,
		top 180ms ease,
		left 180ms ease,
		width 180ms ease,
		height 180ms ease;
}


/* DISABLED */

.hello-submit:disabled {
	opacity: 0.25;
	cursor: not-allowed;
}


/*
   The button is disabled while sending,
   but should remain fully visible.
*/

.hello-submit.is-folding,
.hello-submit.is-flying {
	opacity: 1;
	cursor: default;
}


/* LABEL */

.hello-submit-label {
	position: relative;
	z-index: 2;

	display: block;

	transition:
		opacity 100ms ease,
		transform 100ms ease;
}


/* SVG FRAME */

.hello-submit-frame {
	position: absolute;
	z-index: 1;

	top: 50%;
	left: 50%;

	display: block;

	width: 160px;
	height: 160px;

	opacity: 0;
	pointer-events: none;

	transform:
		translate(-50%, -50%);
}


/* FOLDING */

.hello-submit.is-folding {
	top: 0;
	left: 0;

	width: 160px;
	height: 160px;

	background: transparent;
}

.hello-submit.is-folding .hello-submit-label {
	opacity: 0;

	transform: scale(0.9);
}

.hello-submit.is-folding .hello-submit-frame {
	opacity: 1;
}


/* FLYING */

.hello-submit.is-flying {
	opacity: 1;
	cursor: default;
}

/* KEYBOARD */

.hello-submit:focus-visible {
	outline: 2px solid var(--color-disrupt);
	outline-offset: 4px;
}


/* REDUCED MOTION */

@media (prefers-reduced-motion: reduce) {

	.hello-submit {
		transition: opacity 180ms ease;
	}

	.hello-submit.is-flying {
		animation:
			hello-plane-fade
			250ms
			ease
			forwards;
	}

	@keyframes hello-plane-fade {

		to {
			opacity: 0;
		}

	}

}

/* ==========================================================================
   HELLO — FORM STATES
   ========================================================================== */

.hello-contact {
	position: relative;
}


/*
   The form remains in the layout so the page
   dimensions never change.
*/

.hello-form {
	transition:
		opacity 250ms ease;
}

.hello-contact.is-showing-state .hello-form {
	visibility: hidden;

	opacity: 0;

	pointer-events: none;
}


/* STATE PANEL */

.hello-state {
	position: absolute;
	z-index: 5;

	inset: 0;

	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;

	opacity: 0;

	text-align: center;

	transform:
		translateY(12px);

	transition:
		opacity 300ms ease,
		transform 300ms ease;
}

.hello-state.is-visible {
	opacity: 1;

	transform:
		translateY(0);
}

.hello-state h2 {
	margin: 0;

	font-family: var(--font-primary);
	font-size: clamp(28px, 2.5vw, 40px);
	font-weight: 500;
	line-height: 1;
	letter-spacing: -0.025em;

	color: var(--color-bg);
}

.hello-state p {
	margin:
		28px
		0
		0;

	font-size: clamp(18px, 1.6vw, 24px);
	line-height: 1.35;

	color: var(--color-bg);
}

.hello-state:focus {
	outline: 0;
}


/* ERROR — TRY AGAIN */

.hello-state-button {
	width: min(100%, 380px);

	margin-top: 56px;
	padding: 18px 24px;

	background: var(--color-disrupt);
	border: 0;
	border-radius: 0;

	font: inherit;
	font-size: 18px;
	color: var(--color-white);

	cursor: pointer;

	transition:
		background-color 180ms ease,
		transform 180ms ease;
}

.hello-state-button:hover {
	transform:
		translateY(-2px);
}

.hello-state-button:focus-visible {
	outline: 2px solid var(--color-bg);
	outline-offset: 4px;
}


/*
   Keep the completed form visually stable
   while it fades away.
*/

.hello-form.is-sent input:disabled,
.hello-form.is-sent textarea:disabled,
.hello-form.is-sent button:disabled {
	opacity: 1;
	color: inherit;
	-webkit-text-fill-color: currentColor;
}

/* ==========================================================================
   TABLET & MOBILE
   ========================================================================== */
@media (max-width: 900px) {

	.hello-content {
		grid-template-columns:
			minmax(0, 3fr)
			minmax(0, 5fr);
		padding-inline: 24px;
		column-gap: clamp(24px, 4vw, 40px);
	}

}

@media (max-width: 600px) {

	.hello-content {
		grid-template-columns: 1fr;
		row-gap: 48px;
		align-self: start;
	}

	.hello-form {
		grid-column: 1;
	}

}