/* fremkode.dk. One stylesheet for the three pages: the front page (logo in the hero, moving
   into the navigation band on scroll), and the plain pages (html.plain: the privacy notice
   and the 404 page, with the logo already in the band). */

@font-face {
	font-family: "Familjen Grotesk";
	font-weight: 600;
	font-display: swap;
	src: url("/fonts/familjen-grotesk/familjen-grotesk-latin-600.woff2") format("woff2");
}

@font-face {
	font-family: "Familjen Grotesk";
	font-weight: 700;
	font-display: swap;
	src: url("/fonts/familjen-grotesk/familjen-grotesk-latin-700.woff2") format("woff2");
}

@font-face {
	font-family: "Schibsted Grotesk";
	font-weight: 400;
	font-display: swap;
	src: url("/fonts/schibsted-grotesk/schibsted-grotesk-latin-400.woff2") format("woff2");
}

:root {
	color-scheme: dark;

	--c-ground: #0C0D0B;
	--c-line: #2A2C27;
	--c-line-strong: #3A3D36;
	--c-text: #EAE6DA;
	--c-text-muted: #B3AFA3;
	--c-text-dim: #8F8B7F;
	--c-accent: #CCFF00;
	--c-ramp-start: #CCFF00;
	--c-ramp-mid: #59EC80;
	--c-ramp-end: #1FE3C0;

	--font-display: "Familjen Grotesk", system-ui, sans-serif;
	--font-text: "Schibsted Grotesk", system-ui, sans-serif;

	--fs-statement: clamp(1.5rem, 1.28rem + 0.939vw, 2.125rem);
	--fs-body: clamp(1rem, 0.956rem + 0.188vw, 1.125rem);

	--gutter: clamp(1.25rem, 9.39vw - 0.95rem, 7.5rem);
	--content-max: 75rem;
	--section-pad: clamp(4rem, 2.768rem + 5.258vw, 7.5rem);

	--header-height: clamp(3.5rem, 3.236rem + 1.127vw, 4.25rem);
	/* The band's distance from the top edge: the page scrolls past above it as well. */
	--header-top: clamp(0.75rem, 0.574rem + 0.751vw, 1.25rem);
	--fs-h2: clamp(1.75rem, 1.486rem + 1.127vw, 2.5rem);
	--fs-h3: clamp(1.25rem, 1.162rem + 0.376vw, 1.5rem);
	--grid-gap: clamp(1.5rem, 0.972rem + 2.254vw, 3rem);
	/* One left edge for the header, the logo and every section. */
	--edge: max(var(--gutter), calc((100% - var(--content-max)) / 2));

	/* The hero logo: 4.25rem keeps the wordmark inside a 375 px phone. */
	--logo-size: clamp(4.25rem, 2.93rem + 5.634vw, 8rem);
	--logo-top: clamp(7rem, 26svh, 16rem);
	--logo-pinned-size: clamp(1.5rem, 1.368rem + 0.563vw, 1.875rem);

	--transition: 120ms ease;
}

@font-face {
	font-family: "Schibsted Grotesk";
	font-weight: 500;
	font-display: swap;
	src: url("/fonts/schibsted-grotesk/schibsted-grotesk-latin-500.woff2") format("woff2");
}

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

/* A column at least one screen plus the logo's travel tall: however little the page holds,
   it scrolls far enough for the logo to finish its move into the band. The footer sits at
   the foot. */
body {
	display: flex;
	flex-direction: column;
	min-height: calc(100svh + var(--logo-top));
	margin: 0;
	background: var(--c-ground);
	color: var(--c-text);
	font-family: var(--font-text);
	font-size: var(--fs-body);
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
}

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

/* Logo: geometry and proportions from Logo.razor. */

.logo {
	color: var(--c-text);
}

.logo--wordmark {
	display: inline-flex;
	align-items: baseline;
	font-family: var(--font-display);
	font-weight: 700;
	line-height: 1;
	letter-spacing: -0.045em;
}

.logo-prefix {
	width: 0.583em;
	height: 0.458em;
	margin-right: 0.07em;
}

.logo-k {
	width: 0.639em;
	height: 0.722em;
	margin-right: -0.045em;
}

.ramp-start {
	stop-color: var(--c-ramp-start);
}

.ramp-mid {
	stop-color: var(--c-ramp-mid);
}

.ramp-end {
	stop-color: var(--c-ramp-end);
}

/* Header. Without script it lies at the top of the page and scrolls away with it: the logo
   at its hero position, no bar. With script (html.js) it is fixed, and v2.js sets --p from 0
   (page at the top) to 1 (logo pinned): the logo follows the page up, shrinking, until it
   lands in .logo-slot; the bar and the navigation, hinted from the start, strengthen with --p. */

.site-header {
	position: absolute;
	inset: var(--header-top) 0 auto;
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: var(--header-height);
	padding-inline: var(--edge);
}

.js .site-header {
	position: fixed;
}

/* The band itself, a strip across the page with a hairline above and below, never opaque: the
   page shows through it and passes above it. On a pseudo-element, since a
   backdrop-filter on the header would capture the fixed logo. */
.site-header::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	border-block: 1px solid var(--c-line);
	box-shadow: 0 0.75rem 2rem rgb(0 0 0 / 0.4);
	background: rgb(12 13 11 / 0.72);
	backdrop-filter: blur(14px);
	/* Hinted while the hero shows, full once the logo is pinned. */
	opacity: calc(0.35 + 0.65 * var(--p, 0));
}

/* The gap between the top edge and the band: what scrolls up past the band is blurred out. */
.site-header::after {
	content: "";
	position: absolute;
	inset: calc(-1 * var(--header-top)) 0 100%;
	backdrop-filter: blur(10px);
	pointer-events: none;
}

/* Where the logo lands: its pinned height, at the header's left edge. */
.logo-slot {
	width: 1px;
	height: var(--logo-pinned-size);
}

.site-logo {
	position: absolute;
	top: var(--logo-top);
	font-size: var(--logo-size);
	text-decoration: none;
	transform-origin: 0 0;
}

.js .site-logo {
	position: fixed;
	will-change: transform;
}

.site-logo .logo--wordmark {
	display: flex;
}

.nav ul {
	display: flex;
	align-items: center;
	gap: clamp(1.25rem, 2.5vw, 2.25rem);
	margin: 0;
	padding: 0;
	list-style: none;
}

.nav li {
	display: none;
}

.nav li:last-child {
	display: block;
}

@media (min-width: 52rem) {
	.nav li {
		display: block;
	}
}

.nav a {
	color: var(--c-text-muted);
	font-size: 0.9375rem;
	font-weight: 500;
	text-decoration: none;
	transition: color var(--transition), border-color var(--transition);
}

/* The links are held back while the hero shows; 0.75 keeps them above AA contrast. */
.nav li:not(:last-child) a {
	opacity: calc(0.75 + 0.25 * var(--p, 0));
}

.nav a:hover {
	color: var(--c-text);
}

/* Kontakt is the button: outlined, and at full strength from the start. */
.nav li:last-child a {
	display: block;
	padding: 0.5rem 1rem;
	border: 1px solid var(--c-line-strong);
	color: var(--c-text);
}

.nav li:last-child a:hover {
	border-color: var(--c-accent);
	color: var(--c-accent);
}

/* Hero: the logo (drawn by the header) and the line close under it. It ends well before the
   foot of the first screen, so the next section's heading shows without scrolling. */

.hero {
	padding: calc(var(--logo-top) + var(--logo-size) + clamp(0.75rem, 0.486rem + 1.127vw, 1.5rem)) var(--edge) clamp(6rem, 19svh, 11rem);
}

/* The glow comes from beyond the left edge at the logo's height and lights the ground behind
   it. It belongs to the top of the page, not to the hero's box, and scrolls away with it. */

main {
	position: relative;
}

main::before {
	content: "";
	position: absolute;
	inset: 0 0 auto;
	z-index: -1;
	height: max(100svh, 48rem);
	background:
		radial-gradient(ellipse max(30rem, 70vw) max(22rem, 62svh) at -10% calc(var(--logo-top) + var(--logo-size) * 0.55),
			rgb(204 255 0 / 0.22) 0%,
			rgb(89 236 128 / 0.12) 36%,
			rgb(31 227 192 / 0.04) 64%,
			transparent 82%);
	pointer-events: none;
}

.hero-line {
	max-width: 24em;
	margin: 0;
	font-family: var(--font-display);
	font-size: var(--fs-statement);
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: -0.015em;
	text-wrap: balance;
}

/* The aside in code brackets: dimmed, on a line of its own under the statement. */
.hero-aside {
	display: block;
	color: var(--c-text-muted);
}

/* The construction band: a barrier tape stamped across the page from edge to edge, slightly
   askew, behind the notice's heading. Its stripes are the logo's chevron repeated at the
   logo's own spacing (brand/barrier.svg, used as a mask) and coloured by the ramp across the
   width of the page, held dim enough that the heading and the first line under it read on top
   of it. Decoration only. */

main {
	overflow-x: clip;
}

.barrier {
	--barrier-height: clamp(4.25rem, 3.634rem + 2.629vw, 6rem);
	position: absolute;
	/* Centred on the heading's one line. */
	top: calc(var(--fs-h2) * 0.55 - var(--barrier-height) / 2);
	left: -5vw;
	width: 110vw;
	height: var(--barrier-height);
	border-block: 1px solid rgb(89 236 128 / 0.3);
	background: rgb(12 13 11 / 0.6);
	box-shadow: 0 0.75rem 2rem rgb(0 0 0 / 0.35);
	transform: rotate(-2.5deg);
	/* Turned about the heading, so the band stays behind it at every width. */
	transform-origin: 25% 50%;
}

.barrier::before {
	content: "";
	position: absolute;
	inset: 0.625rem 0;
	background: linear-gradient(to right, var(--c-ramp-start), var(--c-ramp-mid) 55%, var(--c-ramp-end));
	mask: url("/brand/barrier.svg") 0 50% / auto 100% repeat-x;
	opacity: 0.3;
}

/* The notice's own content lies on top of the band. */
.notice {
	position: relative;
}

.notice > :not(.barrier) {
	position: relative;
}

.notice h2,
.notice .section-lead {
	text-shadow: 0 0 0.75rem var(--c-ground), 0 0 0.25rem var(--c-ground);
}

/* The notice: that the site is being built, what the company does, and who it is. */

main {
	flex: 1;
}

.notice {
	padding: 0 var(--edge) var(--section-pad);
	scroll-margin-top: calc(var(--header-top) + var(--header-height) + 1.5rem);
}

.notice h2 {
	margin: 0 0 0.75rem;
	font-family: var(--font-display);
	font-size: var(--fs-h2);
	font-weight: 600;
	line-height: 1.1;
	letter-spacing: -0.02em;
}

.section-lead {
	max-width: 36em;
	margin: 0 0 clamp(1.5rem, 1.148rem + 1.502vw, 2.5rem);
	color: var(--c-text-muted);
	text-wrap: pretty;
}

/* The contact card, on the front page and in the privacy notice: a business card. The person
   on the left (name, e-mail address), the company on the right under its logo (name and CVR
   number on one line, postal district); stacked on a phone. The CVR number is text, not a
   link to the register. Softened corners, the ramp's light coming in
   from two opposite corners, and a border that shows only at those corners. */
.card {
	position: relative;
	display: grid;
	gap: 1.5rem;
	max-width: 38rem;
	padding: clamp(1.5rem, 1.148rem + 1.502vw, 2.5rem);
	border-radius: 0.75rem;
	background:
		radial-gradient(ellipse 75% 130% at 0% 0%, rgb(204 255 0 / 0.11), transparent 62%),
		radial-gradient(ellipse 65% 120% at 100% 100%, rgb(31 227 192 / 0.1), transparent 66%),
		rgb(234 230 218 / 0.035);
	box-shadow: 0 1.25rem 3rem rgb(0 0 0 / 0.4);
	font-style: normal;
}

.card::before {
	content: "";
	position: absolute;
	inset: 0;
	border: 1px solid;
	border-color: var(--c-ramp-start) var(--c-ramp-end) var(--c-ramp-end) var(--c-ramp-start);
	border-radius: inherit;
	mask-image:
		radial-gradient(circle 6rem at 0 0, #000 20%, transparent 100%),
		radial-gradient(circle 6rem at 100% 100%, #000 20%, transparent 100%);
	opacity: 0.75;
	pointer-events: none;
}

@media (min-width: 36rem) {
	.card {
		grid-template-columns: minmax(0, 1fr) auto;
		align-items: center;
		gap: clamp(1.5rem, 0.444rem + 4.507vw, 3.5rem);
	}

	.card-company {
		padding-left: clamp(1.5rem, 0.444rem + 4.507vw, 3.5rem);
		border-left: 1px solid var(--c-line-strong);
		white-space: nowrap;
	}
}

@media not (min-width: 36rem) {
	.card-company {
		padding-top: 1.5rem;
		border-top: 1px solid var(--c-line-strong);
	}
}

.card-name {
	display: block;
	margin-bottom: 0.25rem;
	font-family: var(--font-display);
	font-size: var(--fs-h3);
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: -0.01em;
}

/* The ways to reach the person, one per row behind a small icon drawn in the logo's green and
   held back: the e-mail address, the LinkedIn profile. */
.card-row {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.card-row + .card-row {
	margin-top: 0.25rem;
}

.row-icon {
	flex: none;
	width: 1.125rem;
	height: 1.125rem;
	fill: none;
	stroke: var(--c-ramp-mid);
	stroke-width: 1.5;
	stroke-linecap: round;
	stroke-linejoin: round;
	opacity: 0.8;
}

.card-logo {
	display: flex;
	margin-bottom: 0.75rem;
	font-size: 1.625rem;
}

.card-line {
	display: block;
	color: var(--c-text-muted);
	font-size: 0.875rem;
}

.card a {
	color: inherit;
	text-decoration: underline;
	text-decoration-color: var(--c-ramp-mid);
	text-underline-offset: 0.25em;
	transition: color var(--transition), text-decoration-color var(--transition);
}

.card a:hover {
	color: var(--c-accent);
	text-decoration-color: currentColor;
}

/* The decoys between the letters of the contact details. The hidden attribute already hides
   them; this holds if a rule ever gives spans a display of their own. */
[hidden] {
	display: none !important;
}

/* The e-mail address in pieces: the at sign and the dot are drawn here, not written in the
   HTML. */
.email-at::before {
	content: "@";
}

.email-dot::before {
	content: ".";
}

.site-footer {
	padding: 1.5rem var(--edge) 2rem;
	border-top: 1px solid var(--c-line);
	color: var(--c-text-dim);
	font-size: 0.8125rem;
}

.site-footer p {
	margin: 0;
}

.site-footer ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-footer a,
.prose a {
	color: inherit;
	text-decoration: underline;
	text-decoration-color: var(--c-text-dim);
	text-underline-offset: 0.2em;
	transition: color var(--transition), text-decoration-color var(--transition);
}

.site-footer a:hover,
.prose a:hover {
	color: var(--c-accent);
	text-decoration-color: currentColor;
}

/* First in the tab order, shown only when focused. */
.skip-link {
	position: absolute;
	top: 0.5rem;
	left: 0.5rem;
	z-index: 20;
	padding: 0.5rem 1rem;
	background: var(--c-accent);
	color: var(--c-ground);
	font-weight: 500;
	text-decoration: none;
	transform: translateY(-200%);
}

.skip-link:focus {
	transform: none;
}

/* Plain pages: no hero. The band is at full strength with the logo in it from the start, and
   the text is one readable column. */

.plain {
	--p: 1;
}

.plain body {
	min-height: 100svh;
}

.plain .site-header {
	position: fixed;
}

.plain .site-logo {
	position: static;
	font-size: var(--logo-pinned-size);
}

.plain main::before {
	opacity: 0.5;
}

.reading {
	max-width: calc(40rem + 2 * var(--edge));
	padding: calc(var(--header-top) + var(--header-height) + clamp(3rem, 2.296rem + 3.005vw, 5rem)) var(--edge) var(--section-pad);
}

.reading h1 {
	margin: 0 0 0.5rem;
	font-family: var(--font-display);
	font-size: var(--fs-h2);
	font-weight: 600;
	line-height: 1.1;
	letter-spacing: -0.02em;
}

.reading .updated {
	margin: 0 0 2rem;
	color: var(--c-text-dim);
	font-size: 0.8125rem;
}

.reading h1 + .prose {
	margin-top: 1.5rem;
}

.prose h2 {
	margin: 2.5rem 0 0.75rem;
	font-family: var(--font-display);
	font-size: var(--fs-h3);
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: -0.01em;
}

.prose p,
.prose ul {
	margin: 0 0 1rem;
	color: var(--c-text-muted);
}

.prose ul {
	padding-left: 1.25rem;
}

.prose li {
	margin-bottom: 0.5rem;
}

.prose strong {
	color: var(--c-text);
	font-weight: 500;
}

.prose .card {
	margin-block: 1.5rem 2rem;
}
