﻿/* ===== Variables ===== */
:root
{
	--header-h: 60px;
	--footer-h: 60px;
	--img-offset-right: clamp(10vw, 12vw, 16vw);
	--img-offset-bottom: 0px;
	--bg-color: #fefefe;
	--white-color: #fff;
	--black-color: #000;
	--dark-color:  #333;
	--machine-reveal: 36vw; /* ancho aproximado del recorte visible de la máquina */
	--machine-fade: 28vw; /* dónde empieza a difuminarse el recorte */

	--text-panel-w: -1; /* texto en la parte blanca */
	--safe-bottom: 140px; /* desktop cómodo */
}

/* ===== Reset & base ===== */
*
{
	box-sizing: border-box;
	margin: 0;
	padding: 0
}

html, body
{
	height: 100%
}

body
{
	font-family: "Special Elite","Courier Prime",ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	color: var(--dark-color);
	background-color: var(--white-color);
	overflow: hidden; /* bloquea scroll global */
}

section
{
	min-height: calc(101dvh - var(--footer-h));
	max-height: calc(101svh - var(--footer-h));
	height: calc(101svh - var(--footer-h));
	display: flex;
	align-items: center;
	overflow: hidden
}

/* ============================================
   ESTILO DE TEXTO GLOBAL (MÁQUINA DE ESCRIBIR)
   ============================================ */

p, .copy, .text, .lead, blockquote, figcaption
{
	font-size: 12px;
	line-height: 2;
	letter-spacing: 0.02em;
	word-spacing: 0.04em;
	text-align: justify;
	text-indent: 2rem;
	margin: 0 0 1.5rem;
	max-width: 70ch;
	margin-left: auto;
	margin-right: auto;
	white-space: pre-line;
	color: #111;
	text-shadow: 0 0 3px rgba(255, 255, 255, 0.75), 0 0 6px rgba(255, 255, 255, 0.45), 0 0 0.5px rgba(0, 0, 0, 0.18);
}

/* Primer párrafo sin sangría */
section > p:first-of-type,
article > p:first-of-type,
div > p:first-of-type
{
	text-indent: 0;
}

/* ============================================
   TÍTULOS Y ENLACES (CORMORANT)
   ============================================ */

h1, h2, h3, h4, h5, h6
{
	font-family: "Cormorant", serif;
	font-weight: 500;
	letter-spacing: 0.01em;
	word-spacing: normal;
	text-align: left;
	color: var(--dark-color);
	text-shadow: none;
	text-transform: none;
	line-height: 1.2;
	margin: 0 0 1rem;
}

h1
{
	font-size: 3rem;
}

h2
{
	font-size: 2.5rem;
}

h3
{
	font-size: 2rem;
}

h4
{
	font-size: 1.75rem;
}

h5
{
	font-size: 1.5rem;
}

h6
{
	font-size: 1.25rem;
}

/* Enlaces y botones */
a, a:visited, a:active, button, .btn, .mini-item, .menu a, a.cta
{
	font-family: "Cormorant", serif !important;
	font-weight: 500;
	font-size: 0.9rem;
	letter-spacing: 0.01em;
	text-decoration: none;
	color: inherit;
	text-shadow: none !important;
	text-indent: 0 !important;
	background-color: rgba(255, 255, 255, 0.5);
	border: none;
	cursor: pointer;
}

	a.button:visited,
	a.button:active,
	a.button:hover
	{
		opacity: 1;
	}

/* Hover */
a:hover, .btn:hover, button:hover
{
	color: var(--dark-color);
	transition: color 0.3s ease;
}

/* ============================================
   LISTAS, BLOQUES Y CITAS
   ============================================ */

li p
{
	text-indent: 0;
	margin: 0;
}

blockquote p
{
	text-indent: 0;
	font-style: italic;
}

/* ============================================
   CLASES GLOBALES
   ============================================ */
.bg-fixed-layer
{
	position: fixed;
	inset: 0;
	z-index: -1;
	background: var(--white-color);
}

/* ============================================
   HEADER
   ============================================ */
header
{
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: var(--header-h);
	display: flex;
	justify-items: center;
	background: rgba(255, 255, 255, 0.75);
	box-shadow: 0 2px 4px rgba(0, 0, 0, .08);
	z-index: 1000;
}

header > h2, p, a
{
	text-align: center;
	width: 100%;
}

header h2
{
	font-size: 1.5rem;
	text-align: center;
	margin: 0;
}

#menuInicio
{
	background: none;
}

/* ================================
   LANG SWITCH GLOBAL (FUERA DE SECCIONES)
   ================================ */
body:not(:has(:target)) .lang-switch,
body:has(#home:target) .lang-switch
{
	position: relative;
	display: flex !important;
	justify-content: center;
	align-items: center;
	margin: 2rem auto 0 auto; /* espacio entre logo y control */
	gap: 0.5rem;
	z-index: 1000;
	transform: none !important;
	width: auto !important;
}

body:has(:target):not(:has(#home:target)) header .lang-switch
{
	position: static !important;
	display: flex !important;
	justify-content: center;
	align-items: center;
	gap: .5rem;
	margin: 0 auto !important;
}

body:has(#content:target) .lang-switch--content
{
	display: flex !important;
}

/* ================================
   VISIBILIDAD DE HEADER Y FOOTER
   ================================ */
body.is-home header,
body.is-home footer {
  display: none !important;
}

body:not(.is-home) header,
body:not(.is-home) footer {
  display: flex !important; /* o block según tu markup */
}


/* ================================
   Estado NO-HOME (cuando hay hash y NO es #home)
   ================================ */
body:has(:target):not(:has(#home:target)) .lang-switch
{
	position: fixed;
	top: 16px;
	right: 16px;
	left: auto;
	transform: none;
	margin: 0 !important;
	width: auto; /* evita estirarlo al 100% */
	display: flex !important;
	justify-content: center;
	align-items: center;
	z-index: 2001;
}

body:has(:target):not(:has(#home:target)) header,
body:has(:target):not(:has(#home:target)) footer
{
	display: flex !important; /* o block, según tu markup */
}


/* ============================================
   HOME
   ============================================ */
#home
{
	display: block;
	height: 100vh;
	min-height: 100vh;
	max-height: 100vh;
	background-image: url('https://jlpetersen.com/images/typewriter.jpg');
	background-size: 100% 70%;
	background-position: bottom;
	background-repeat: no-repeat;
	background-attachment: scroll;
	text-align: center;
	color: var(--black-color);
	padding: 0.5em 0 0 0;
}

#home .logo
{
	width: 100%;
	max-width: 700px;
	height: auto;
}

	#home .intro-text
	{
		line-height: 1.5;
		text-align: center;
		margin: 0;
		padding: 0;
		width: 90%;
		max-width: 90%;
		min-width: 90%;
		justify-self: center;
	}

	#home .buttons
	{
		display: flex;
		flex-direction: column;
		gap: 1rem;
		justify-self: center;
	}

#home .button
{
	font-family: "Special Elite","Courier Prime",ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace !important;
	padding: 0.75rem 2rem;
	border: 2px solid var(--dark-color);
	background: transparent;
	font-size: 1em;
	font-weight: 500;
	transition: all 0.3s ease;
}

#home .button:hover
{
	background: var(--dark-color);
	color: var(--white-color);
}

#home .social-icons
{
	display: inline-flex;
	gap: 1.5rem;
	margin-top: 1.5rem;
}

#home .social-button
{
	font-size: 1.8rem;
	color: var(--dark-color);
	transition: color 0.3s ease;
}

#home .social-button:hover
{
	color: #000;
}
/* ============================================
   CONTENT
   ============================================ */

#content
{
	position: relative;
	overflow: hidden;
	/* Capa base: silueta a la derecha, máquina abajo (no recorta la cara) */
	background-image: url("images/about_white_bg.jpg");
	background-repeat: no-repeat;
	background-position: right bottom;
	background-size: cover; /* llenamos el contenedor */
	isolation: isolate;
}

#content::before
{
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	z-index: 0; /* por detrás del texto */
	background-image: url("images/about_white_bg.jpg");
	background-repeat: no-repeat;
	background-position: left bottom; /* anclamos la máquina a la IZQUIERDA */
	background-size: contain; /* se ve completa esa esquina */
	/* Máscara para mostrar solo el bloque inferior izquierdo
(se desvanece hacia la derecha para mezclarse con la capa base) */
	-webkit-mask-image: linear-gradient( to right, var(--black-color) calc(var(--machine-reveal) - var(--machine-fade)), rgba(0,0,0,.25) calc(var(--machine-reveal) - var(--machine-fade)/2), transparent var(--machine-reveal) );
	mask-image: linear-gradient( to right, var(--black-color) calc(var(--machine-reveal) - var(--machine-fade)), rgba(0,0,0,.25) calc(var(--machine-reveal) - var(--machine-fade)/2), transparent var(--machine-reveal) );
}

/* Panel de texto */
#content .content-panel
{
	position: absolute;
	inset: 0 auto 0 0;
	width: var(--text-panel-w);
	display: flex;
	flex-direction: column;
	background: transparent;
	z-index: 1;
	padding: 1vw 1vw 0;
}

#content .content-panel::after
{
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 28px; /* menos alto */
	pointer-events: none;
	z-index: 2;
	background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,0.12) 60%, rgba(255,255,255,0.22) 100% );
}

#content .text-panel
{
	position: relative;
	z-index: 1;
	width: 70%;
	height: 100%;
	overflow-y: auto;
	padding: 4rem;
	background: transparent; /* sin fondo */
	box-sizing: border-box;
}

#content .container
{
	width: 100%
}

#content .content
{
	width: 100%
}

/* Intro fijo al cargar #content */
#content .intro-hero
{
	padding: 100px 10px 0 10px;
	transition: opacity 0.6s ease, transform 0.6s ease;
}

#content .intro-hero.hidden
{
	opacity: 0;
	transform: translateY(-10px);
	pointer-events: none;
	height: 0;
	margin: 0;
	overflow: hidden;
}

#content .intro-hero .intro-text
{
	white-space: pre-line; /* por si quieres saltos de línea */
	margin: 0;
	text-indent: 0; /* sin sangría en el primer párrafo del intro */
	text-align: justify;
}

/* Tabs */
#content .menu
{
	position: sticky;
	top: 0;
	z-index: 3;
	display: flex;
	gap: .5rem;
}

.mini-item, .tw-title
{
	font-family: 'Cormorant',serif;
	font-weight: 600;
}

.mini-item
{
	appearance: none;
	border: 1px solid var(--black-color);
	border-radius: 10px;
	padding: 5px;
	cursor: pointer;
}
.mini-item:hover
{
	transform: translateY(-1px);
	background: var(--white-color);
	border-color: var(--black-color);
}

.mini-item[aria-selected="true"]
{
	background-color: var(--dark-color);
	color: var(--white-color);
	border-color: var(--dark-color);
}

/* Typewriter con scroll interno del texto */
.typewriter
{
	overflow: hidden;
	margin-top: 2rem
}

/* Scroll interno del texto */
.tw-scrollable
{
	flex: 1 1 auto;
	padding-right: .8rem;
	/* puedes dejar un padding mínimo, pero no dependas solo de él */
	padding-bottom: 0;
	mix-blend-mode: normal;
	text-shadow: -1px -1px 2px rgba(255,255,255,0.9), 1px -1px 2px rgba(255,255,255,0.9), -1px 1px 2px rgba(255,255,255,0.9), 1px 1px 2px rgba(255,255,255,0.9);
	height: 55vh;
	overflow-y: auto;
}

#content .tw-scrollable *
{
	color: inherit !important;
	mix-blend-mode: inherit !important;
}

.tw-scrollable::-webkit-scrollbar
{
	width: 8px
}

.tw-scrollable::-webkit-scrollbar-track
{
	background: #f1f1f1;
	border-radius: 4px
}

.tw-scrollable::-webkit-scrollbar-thumb
{
	background: #888;
	border-radius: 4px
}

.tw-scrollable::-webkit-scrollbar-thumb:hover
{
	background: #555
}

.tw-title
{
	position: sticky;
	top: 0;
	z-index: 2;
	padding: .25rem 0;
}

.tw-text
{
	white-space: pre-line;
	line-height: 1.7;
	font-size: 1.05rem
}

/* ============================================
   PROYECTOS
   ============================================ */
#proyectos
{
	background: var(--white-color);
	color: var(--dark-color);
	justify-content: center;
}

.scrollable-section
{
	overflow-y: auto;
	-webkit-overflow-scrolling: touch
}

.gallery-container
{
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 1rem
}

.gallery-item
{
	position: relative;
	width: 300px;
	height: 400px;
	overflow: hidden;
	border-radius: 8px;
	box-shadow: 0 4px 6px rgba(0,0,0,.1)
}

.gallery-item img
{
	width: 100%;
	height: 100%;
	object-fit: cover
}

.gallery-item .button
{
	position: absolute;
	bottom: 10px;
	left: 50%;
	transform: translateX(-50%)
}

/* ============================================
   LANGUAGE SWITCH
   ============================================ */
.lang-switch
{
	display: flex;
	gap: .4rem;
	align-items: center;
	justify-content: flex-end;
	margin-bottom: .5rem;
	margin-right: 4rem;
	width: 100%;
}

.lang-btn
{
	appearance: none;
	border: 1px solid var(--black-color);
	background: var(--white-color);
	color: #111;
	padding: .35rem .6rem;
	border-radius: 10px;
	cursor: pointer;
	font-weight: 600;
}

	.lang-btn[aria-pressed="true"]
	{
		background: var(--dark-color);
		color: var(--white-color);
		border-color: var(--dark-color);
	}


/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 5000px)
{
	#home .logo
	{
		width: 50%;
	}
}

@media (max-width: 2000px)
{
	:root
	{
		--machine-reveal: 42vw;
		--machine-fade: 30vw;
	}

	#home .logo
	{
		width: 80%;
	}

}

@media (max-width: 1882px)
{
	:root
	{
		--text-panel-w: 45%;
	}
}

@media (max-width: 1637px)
{
	:root
	{
		--text-panel-w: 43%;
	}
}

@media (max-width: 1200px)
{
	:root
	{
		--text-panel-w: 50%;
	}
}

@media (max-width: 999px)
{
	:root
	{
		--text-panel-w: 55%;
	}
}

@media (min-width: 768px) and (max-width: 1000px)
{
	:root
	{
		--machine-reveal: 42vw;
		--machine-fade: 30vw;
	}
}

@media (max-width: 768px)
{
	:root
	{
		--img-offset-right: clamp(14vw, 18vw, 22vw);
		--safe-bottom: 110px;
		--machine-reveal: 48vw;
		--machine-fade: 32vw;
	}

	h3, h2
	{
		font-size: 1.3rem;
	}

	p,
	#content .tw-scrollable .tw-text,
	.prose,
	.copy,
	.lead,
	blockquote,
	figcaption
	{
		font-size: 0.7rem;
		text-indent: 1.5rem;
		line-height: 1.9;
		max-width: 68ch;
	}

	body:not(.is-home) .lang-switch
	{
		position: relative;
		display: flex !important;
		justify-content: center;
		align-items: center;
		margin: 2rem auto 0 auto;
		gap: 0.5rem;
		z-index: 1000;
		transform: none !important;
		width: auto !important;
	}

	/* Opcional: ocultarlo cuando estás en home */
	body.is-home .lang-switch
	{
		display: none;
	}

	#home
	{
		background-size: 100% 90vh;
	}

		#home .buttons
		{
			width: 100%;
			align-items: center;
		}

		#content .menu
		{
			top: 12%;
		}

	.typewriter
	{
		margin-top: 5rem;
		padding-left: 10px;
	}

	#content .tw-scrollable .tw-text
	{
		font-size: 0.8rem !important;
		padding: 0;
	}

	.intro-text
	{
		width: 100%;
	}

	.buttons
	{
		gap: 10px
	}

	.button
	{
		width: 70%;
		min-width: 70%;
		font-size: .9em
	}
}


@media (max-width: 600px)
{
	:root
	{
		--text-panel-w: 60%;
	}

	#home .button
	{
		width: 80%;
		margin: 0 auto;
	}

	#home .social-button
	{
		font-size: 1.5rem;
	}

}

@media (max-width: 540px)
{
	:root
	{
		--text-panel-w: 63%;
	}
}

@media (max-width: 500px)
{
}

@media (max-width: 400px)
{
	:root
	{
		--img-offset-right: clamp(18vw, 22vw, 26vw);
		--safe-bottom: 90px;
	}

	p, .prose, .copy, .lead, blockquote, figcaption
	{
		font-size: .96rem;
		text-indent: 1.25rem;
		line-height: 1.85;
		max-width: 64ch;
	}

}

@media (max-width: 300px)
{
}

/* ============================================
   FOOTER
   ============================================ */
footer
{
	position: fixed;
	left: 0;
	bottom: 0;
	width: 100%;
	height: var(--footer-h);
	background: var(--dark-color);
	color: var(--white-color);
	text-align: center;
	padding: 10px;
	z-index: 1000;
	display: flex;
	align-items: center;
	justify-content: center;
}

	footer .social-button
	{
		color: var(--white-color) !important;
	}

	footer a
	{
		background: none;
	}

	/* A11y util */
	.visually-hidden
	{
		position: absolute !important;
		width: 1px !important;
		height: 1px !important;
		padding: 0 !important;
		margin: -1px !important;
		overflow: hidden !important;
		clip: rect(0,0,0,0) !important;
		white-space: nowrap !important;
		border: 0 !important;
	}








/* === TEMA MÁQUINA DE ESCRIBIR VINTAGE === */
/* Aplica a los textos largos dentro del área de lectura */


/* Simulación de papel/grano sutil SOLO sobre el texto, sin tapar la imagen */
#content .tw-scrollable
{
	position: relative;
}

	#content .tw-scrollable::before
	{
		content: "";
		position: absolute;
		inset: 0;
		pointer-events: none;
		z-index: 1; /* por encima del texto pero muy tenue */
		background: radial-gradient(transparent 96%, rgba(0,0,0,0.02) 100%) 0 0/6px 6px, radial-gradient(rgba(0,0,0,0.02) 35%, transparent 36%) 2px 1px/6px 6px;
		opacity: .35; /* baja si lo notas “sucio” */
		mix-blend-mode: multiply; /* se integra con el texto */
	}

	/* Subrayado mecánico tipo cinta (para <a> o <em>) */
	#content .tw-scrollable a,
	#content .tw-scrollable em
	{
		text-decoration: none;
		border-bottom: 1px solid rgba(0,0,0,0.6);
		padding-bottom: 0.03em;
	}

	/* Negrita como doble golpe de tecla */
	#content .tw-scrollable strong,
	#content .tw-scrollable b
	{
		font-weight: 700;
		letter-spacing: 0.015em;
	}

	/* Cursiva “inclinada” (máquinas que lo simulaban) */
	#content .tw-scrollable i
	{
		transform: skewX(-4deg);
		display: inline-block;
	}

	/* Cursor/selección como papel entintado */
	#content .tw-scrollable ::selection
	{
		background: var(--black-color);
		color: var(--white-color);
	}

/* Efecto “alineación imperfecta” leve (opcional; comenta si no lo quieres) */
@media (prefers-reduced-motion: no-preference)
{
	#content .tw-scrollable p
	{
		position: relative;
		animation: vt-jitter 6s steps(2, end) infinite;
	}

	@keyframes vt-jitter
	{
		0%, 100%
		{
			transform: translateX(0);
		}

		50%
		{
			transform: translateX(0.3px);
		}
		/* micro desajuste */
	}
}

/* Si quieres intensificar el look “cinta gastada”, activa este filtro:
*/#content .tw-scrollable {
  filter: contrast(1.06) saturate(0.98);
}


/* Mantén tu sombra blanca existente para legibilidad sobre zonas mixtas — puedes combinar: */
#content .tw-scrollable
{
	text-shadow: 0 0 3px rgba(255,255,255,0.75), 0 0 6px rgba(255,255,255,0.45), 0 0 0.5px rgba(0,0,0,0.20);
}


	/* --- Estilo literario para texto de máquina de escribir --- */
	#content .tw-scrollable .tw-text
	{
		text-align: justify; /* Justifica como en libros */
		line-height: 2; /* Doble interlineado */
		font-size: 1.1rem;
		letter-spacing: 0.02em;
		word-spacing: 0.04em;
		max-width: 70ch; /* Tamaño de columna óptimo */
		margin: 0 auto;
		padding: 1rem 0;
	}

		/* Sangría de la primera línea */
		#content .tw-scrollable .tw-text p
		{
			text-indent: 2em !important; /* sangría clásica */
			margin-bottom: 1.5rem; /* espacio entre párrafos */
		}

	/* Si el texto entra sin <p>, podemos forzar saltos en los \n */
	#content .tw-scrollable .tw-text
	{
		white-space: pre-line; /* respeta saltos de línea del data-text */
	}

	/* Opcional: efecto máquina de escribir más elegante */
	#content .tw-scrollable .tw-text
	{
		font-family: "Special Elite", "Courier Prime", monospace;
		font-feature-settings: "liga" 0, "calt" 0;
		font-variant-ligatures: none;
		letter-spacing: 0.015em;
	}

