/* ==========================================================================
   CONTRACULTO — corporate site
   Fanzine design system. One stylesheet, two themes via html[data-theme].
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */

:root {
	/* Rosa (light) theme */
	--color-paper: #f4edec;
	--color-ink: #1d1316;
	--color-accent: #e3125f;
	--color-on-accent: #f4edec;
	--color-line: rgba(29, 19, 22, .14);

	/* Type */
	--font-display: 'Anton', 'Arial Narrow', sans-serif;
	--font-body: 'Space Grotesk', 'Helvetica Neue', sans-serif;
	--font-mono: 'Space Mono', 'Courier New', monospace;

	/* Rhythm */
	--gutter: 1.5rem;
}

html[data-theme="dark"] {
	/* Midnight theme */
	--color-paper: #121110;
	--color-ink: #ece5d3;
	--color-accent: #d4ff3f;
	--color-on-accent: #121110;
	--color-line: rgba(236, 229, 211, .16);
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */

*, *::before, *::after {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	background: var(--color-paper);
	color: var(--color-ink);
	font-family: var(--font-body);
	font-size: 1rem;
	line-height: 1.6;
	overflow-x: hidden;
	cursor: crosshair;
}

/* Paper grain overlay */
body::before {
	content: "";
	position: fixed;
	inset: 0;
	z-index: 50;
	pointer-events: none;
	opacity: .5;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection {
	background: var(--color-accent);
	color: var(--color-on-accent);
}

h1, h2, h3, p, ul {
	margin: 0;
}

ul {
	padding: 0;
	list-style: none;
}

a {
	color: inherit;
}

:focus-visible {
	outline: 2px solid var(--color-accent);
	outline-offset: 3px;
}

/* --------------------------------------------------------------------------
   3. Site header
   -------------------------------------------------------------------------- */

.site-header {
	position: fixed;
	top: 0;
	right: 0;
	left: 0;
	z-index: 40;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1rem var(--gutter);
	font-family: var(--font-mono);
	font-size: .8rem;
}

.site-header__brand {
	font-weight: 700;
	letter-spacing: .05em;
	text-decoration: none;
}

.site-header__brand sup {
	color: var(--color-accent);
}

.site-nav {
	display: flex;
	align-items: center;
	gap: 1.4rem;
}

.site-nav__link {
	text-decoration: none;
	border-bottom: 2px solid transparent;
}

.site-nav__link:hover {
	border-color: var(--color-accent);
}

/* Small square buttons (language + theme) */
.lang-toggle,
.theme-toggle {
	padding: .35rem .6rem;
	border: none;
	background: var(--color-ink);
	color: var(--color-paper);
	font-family: var(--font-mono);
	font-size: .8rem;
	cursor: pointer;
}

.lang-toggle:hover,
.theme-toggle:hover {
	background: var(--color-accent);
	color: var(--color-on-accent);
}

.theme-toggle {
	display: inline-flex;
	align-items: center;
	padding: .42rem .5rem;
}

.theme-toggle__icon {
	display: block;
}

.theme-toggle__icon[hidden] {
	display: none;
}

/* --------------------------------------------------------------------------
   4. Hero
   -------------------------------------------------------------------------- */

.hero {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	min-height: 100svh;
	padding: 0 var(--gutter) 2rem;
}

.hero__wordmark {
	font-family: var(--font-display);
	font-size: clamp(4.5rem, 17vw, 15rem);
	font-weight: 400;
	line-height: .82;
	letter-spacing: -.01em;
	text-transform: uppercase;
}

.hero__word {
	display: block;
	white-space: nowrap;
}

.hero__word--outline {
	color: transparent;
	-webkit-text-stroke: 2px var(--color-ink);
}

.hero__asterisk {
	color: var(--color-accent);
	font-size: .35em;
	vertical-align: super;
}

.hero__star {
	position: absolute;
	top: 16%;
	left: 8%;
	width: clamp(70px, 10vw, 150px);
	fill: var(--color-accent);
	animation: spin 14s linear infinite;
}

@keyframes spin {
	to { transform: rotate(360deg); }
}

.hero__coordinates {
	position: absolute;
	top: 5rem;
	right: var(--gutter);
	font-family: var(--font-mono);
	font-size: .75rem;
	line-height: 1.7;
	text-align: right;
}

.hero__coordinates strong {
	color: var(--color-accent);
	font-weight: 700;
}

.hero__footer {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 1rem;
	margin-top: 1.5rem;
	padding-top: 1rem;
	border-top: 2px solid var(--color-ink);
	font-family: var(--font-mono);
	font-size: .85rem;
}

.hero__lede {
	max-width: 34ch;
	font-weight: 700;
	font-size: clamp(1.05rem, 2.2vw, 1.6rem);
	line-height: 1.25;
}

/* --------------------------------------------------------------------------
   5. Marquee
   -------------------------------------------------------------------------- */

.marquee {
	overflow: hidden;
	padding: .55rem 0;
	border-top: 2px solid var(--color-ink);
	border-bottom: 2px solid var(--color-ink);
	background: var(--color-ink);
	color: var(--color-paper);
	font-family: var(--font-display);
	font-size: clamp(1.2rem, 3vw, 2rem);
	text-transform: uppercase;
	white-space: nowrap;
}

.marquee__track {
	display: inline-block;
	animation: slide 22s linear infinite;
}

.marquee__word {
	margin: 0 1.2rem;
}

.marquee__accent {
	color: var(--color-accent);
}

@keyframes slide {
	to { transform: translateX(-50%); }
}

/* --------------------------------------------------------------------------
   6. Sections — shared
   -------------------------------------------------------------------------- */

.section-label {
	font-family: var(--font-mono);
	font-size: .75rem;
	font-weight: 400;
	letter-spacing: .15em;
	text-transform: uppercase;
}

.section-label::before {
	content: "■ ";
	color: var(--color-accent);
}

.section-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	padding-bottom: .6rem;
	border-bottom: 2px solid var(--color-ink);
}

.section-head__title {
	font-family: var(--font-display);
	font-size: clamp(2rem, 6vw, 4.5rem);
	font-weight: 400;
	line-height: 1;
	text-transform: uppercase;
}

.section-head__meta {
	font-family: var(--font-mono);
	font-size: .75rem;
	letter-spacing: .15em;
	text-transform: uppercase;
}

.section-head__link {
	font-family: var(--font-mono);
	font-size: .75rem;
	letter-spacing: .15em;
	text-transform: uppercase;
	text-decoration: none;
}

.section-head__link:hover {
	color: var(--color-accent);
}

/* --------------------------------------------------------------------------
   7. Manifesto
   -------------------------------------------------------------------------- */

.manifesto {
	display: grid;
	grid-template-columns: 1fr 2fr;
	gap: 2rem;
	padding: 6rem var(--gutter);
}

.manifesto__text {
	max-width: 22ch;
	font-size: clamp(1.4rem, 3.2vw, 2.6rem);
	font-weight: 500;
	line-height: 1.18;
}

.manifesto__text em {
	padding: 0 .18em;
	background: var(--color-accent);
	color: var(--color-on-accent);
	font-style: normal;
}

/* --------------------------------------------------------------------------
   8. Selected work
   -------------------------------------------------------------------------- */

.work {
	padding: 2rem var(--gutter) 5rem;
}

.project-item {
	display: grid;
	grid-template-columns: auto 1fr auto auto;
	align-items: baseline;
	gap: 1.2rem;
	padding: 1.4rem 0;
	border-bottom: 1px solid var(--color-line);
	transition: background .12s steps(2);
}

.project-item:hover {
	background: var(--color-accent);
}

.project-item:hover :is(h3, p, span) {
	color: var(--color-on-accent);
}

.project-item:hover .project-item__name a {
	color: var(--color-on-accent);
}

.project-item__number {
	font-family: var(--font-mono);
	font-size: .8rem;
}

.project-item__name {
	font-family: var(--font-display);
	font-size: clamp(1.6rem, 4.5vw, 3.4rem);
	font-weight: 400;
	line-height: 1;
	text-transform: uppercase;
}

.project-item__name a {
	text-decoration: none;
}

.project-item__name a:hover {
	text-decoration: underline;
}

.project-item__description {
	max-width: 30ch;
	justify-self: end;
	font-family: var(--font-mono);
	font-size: .78rem;
	line-height: 1.5;
	text-align: right;
}

.project-item__status {
	padding: .2rem .5rem;
	border: 1.5px solid var(--color-ink);
	font-family: var(--font-mono);
	font-size: .7rem;
	text-transform: uppercase;
	white-space: nowrap;
}

.project-item:hover .project-item__status {
	border-color: var(--color-on-accent);
}

.status--live {
	background: var(--color-ink);
	color: var(--color-paper);
}

/* --------------------------------------------------------------------------
   9. Open source
   -------------------------------------------------------------------------- */

.open-source {
	padding: 2rem var(--gutter) 6rem;
}

.oss-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 1.2rem;
	margin-top: 2rem;
}

.oss-card {
	display: flex;
	flex-direction: column;
	gap: .7rem;
	min-height: 150px;
	padding: 1.1rem;
	border: 2px solid var(--color-ink);
	text-decoration: none;
	transition: transform .15s ease, box-shadow .15s ease;
}

.oss-card:hover {
	transform: translate(-4px, -4px);
	box-shadow: 6px 6px 0 var(--color-accent);
}

.oss-card__name {
	font-family: var(--font-mono);
	font-size: 1rem;
	font-weight: 700;
}

.oss-card__description {
	flex: 1;
	font-size: .85rem;
	line-height: 1.45;
}

.oss-card__license {
	font-family: var(--font-mono);
	font-size: .7rem;
	font-weight: 700;
	text-transform: uppercase;
	color: var(--color-accent);
}

/* --------------------------------------------------------------------------
   10. Site footer
   -------------------------------------------------------------------------- */

.site-footer {
	padding: 4rem var(--gutter) 2rem;
	background: var(--color-ink);
	color: var(--color-paper);
}

.site-footer__cta {
	font-family: var(--font-display);
	font-size: clamp(3rem, 11vw, 9rem);
	line-height: .9;
	text-decoration: none;
	text-transform: uppercase;
}

.site-footer__cta:hover {
	color: var(--color-accent);
}

.site-footer__meta {
	display: flex;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 1.5rem;
	margin-top: 3rem;
	padding-top: 1.2rem;
	border-top: 1px solid color-mix(in srgb, currentColor 25%, transparent);
	font-family: var(--font-mono);
	font-size: .78rem;
}

.site-footer__address {
	font-style: normal;
}

.site-footer__address a {
	text-decoration: none;
	border-bottom: 1px dotted currentColor;
}

.site-footer__address a:hover {
	color: var(--color-accent);
	border-color: var(--color-accent);
}

/* --------------------------------------------------------------------------
   11. Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 760px) {
	.project-item {
		grid-template-columns: auto 1fr;
		grid-template-rows: auto auto;
	}

	.project-item__description {
		grid-column: 2;
		justify-self: start;
		text-align: left;
	}

	.manifesto {
		grid-template-columns: 1fr;
		gap: 1rem;
	}

	.hero__coordinates {
		position: static;
		margin-top: 5.5rem;
		text-align: left;
		order: -1;
	}

	.site-nav {
		gap: .9rem;
	}
}

/* --------------------------------------------------------------------------
   12. Reduced motion
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	.marquee__track,
	.hero__star {
		animation: none;
	}

	.oss-card,
	.oss-card:hover {
		transform: none;
	}
}
