/* Nulinea landing — monochrome drawing sheet with one redline accent */
:root {
	--paper: #f3f2ef;
	--paper-2: #e8e7e3;
	--line: rgb(17 17 17 / 12%);
	--ink: #111;
	--ink-2: #5c5c5c;
	--night: #0f0f0f;
	--night-ink: #f2f1ee;
	--color-accent: #d7381e; /* the redline: Proofread marks, ticks, progress */
	--serif: 'IBM Plex Mono', ui-monospace, monospace;
	--sans: 'IBM Plex Mono', ui-monospace, monospace;
	--mono: 'IBM Plex Mono', ui-monospace, monospace;
	--gutter: clamp(16px, 2.6vw, 40px);
	--ease: cubic-bezier(0.8, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--sans);
	font-weight: 400;
	-webkit-font-smoothing: antialiased;
	overflow: hidden;
}
html, body { height: 100%; overscroll-behavior: none; }
/* a faint drafting grain over everything */
body::after {
	content: '';
	position: fixed;
	inset: 0;
	pointer-events: none;
	z-index: 200;
	opacity: 0.05;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
.mono { font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.js [data-line]:not(.is-ready) { visibility: hidden; }
:focus-visible { outline: 1px solid var(--color-accent); outline-offset: 4px; }

/* ---------- frame ---------- */
.frame {
	position: fixed;
	z-index: 50;
	top: 0; left: 0; right: 0;
	display: flex;
	align-items: center;
	gap: 24px;
	padding: 18px var(--gutter);
	pointer-events: none;
	mix-blend-mode: difference;
	color: #fff;
}
.frame > * { pointer-events: auto; }
.frame__logo { font-family: var(--serif); font-size: 18px; font-weight: 500; text-decoration: none; letter-spacing: -0.01em; }
.frame__logo span { font-family: var(--sans); font-size: 10px; vertical-align: super; }
.frame__meta { margin-left: auto; opacity: 0.7; }
.frame__cta { text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 2px; }
@media (max-width: 640px) { .frame__meta { display: none; } .frame__cta { margin-left: auto; } }

/* ---------- hero ---------- */
.hero {
	--pad-top: clamp(68px, 10.5vh, 96px);
	position: relative;
	height: 100vh;
	height: 100svh;
	overflow: hidden;
	padding: var(--pad-top) var(--gutter) clamp(18px, 3.6vh, 36px);
	display: grid;
	grid-template-rows: auto auto minmax(0, 1fr) auto;
	gap: clamp(12px, 2.4vh, 28px);
}
/* the 12-column structural grid, drawn faintly behind the brief */
.hero__grid {
	position: absolute;
	inset: 0 var(--gutter);
	display: grid;
	grid-template-columns: repeat(12, 1fr);
	gap: var(--gutter);
	pointer-events: none;
}
.hero__grid span { border-inline: 1px solid rgb(17 17 17 / 4.5%); }
@media (max-width: 640px) { .hero__grid { grid-template-columns: repeat(4, 1fr); } .hero__grid span:nth-child(n+5) { display: none; } }

.hero__label { display: flex; align-items: center; gap: 10px; margin: 0; color: var(--ink-2); position: relative; }
.tick { width: 28px; height: 1px; background: var(--color-accent); }

.hero__text {
	position: relative;
	max-width: 44em;
	/* sized by width and height, so the whole home always fits one screen */
	font-size: clamp(13px, min(1.45vw, 2.4vh), 21px);
	line-height: 1.4;
	letter-spacing: -0.01em;
	font-weight: 400;
}
.hero__text p, .hero__big p { margin: 0; }
.hero__big {
	position: relative;
	align-self: end;
	font-family: var(--serif);
	font-weight: 400;
	font-size: clamp(38px, min(10.6vw, 18.5vh), 196px);
	font-weight: 300;
	line-height: 0.92;
	letter-spacing: -0.02em;
	color: var(--ink);
}
.hero__big p:nth-child(2) { font-style: italic; padding-left: 8.33vw; }

.hero__foot {
	position: relative;
	display: flex;
	justify-content: space-between;
	align-items: end;
	gap: clamp(16px, 2.4vh, 32px);
	flex-wrap: wrap;
	padding-top: clamp(12px, 2vh, 20px);
	border-top: 1px solid var(--line);
}
.spec { display: grid; grid-template-columns: repeat(3, minmax(0, 220px)); gap: 28px; margin: 0; }
.spec dt { color: var(--ink-2); margin-bottom: 6px; }
.spec dd { margin: 0; color: var(--ink); text-transform: none; font-family: var(--sans); font-size: 13px; letter-spacing: 0; line-height: 1.35; }
@media (max-width: 860px) { .spec { grid-template-columns: 1fr 1fr; gap: 14px 24px; } }
@media (max-width: 640px) {
	.spec div:nth-child(3) { display: none; }
	.index-btn { width: 100%; }
}

.replay { position: absolute; right: var(--gutter); top: var(--pad-top); color: var(--ink-2); }
.replay:hover { color: var(--color-accent); }
@media (max-width: 640px) { .replay { display: none; } }

/* ---------- the index button ---------- */
.index-btn {
	position: relative;
	display: flex;
	align-items: center;
	gap: 18px;
	padding: 14px 26px 14px 14px;
	background: var(--ink);
	color: var(--paper);
	border-radius: 999px;
	z-index: 3;
}
.index-btn__icon {
	display: grid;
	grid-template-columns: repeat(3, 8px);
	gap: 3px;
	padding: 13px;
	background: var(--paper);
	border-radius: 50%;
}
.index-btn__icon i { width: 8px; height: 8px; background: var(--ink); border-radius: 1px; transition: transform 0.6s var(--ease), background 0.3s; }
.index-btn:hover .index-btn__icon i { background: var(--color-accent); }
.index-btn:hover .index-btn__icon i:nth-child(3n+1) { transform: translateY(3px); }
.index-btn:hover .index-btn__icon i:nth-child(3n+3) { transform: translateY(-3px); }
.index-btn__label { display: grid; text-align: left; gap: 2px; }
.index-btn__mask { overflow: hidden; height: 1.25em; font-size: 15px; line-height: 1.25; }
.index-btn__roll { display: grid; transition: transform 0.6s var(--ease); }
.index-btn:hover .index-btn__roll { transform: translateY(-50%); }
.index-btn__roll span:last-child { font-style: italic; }
.index-btn__count { opacity: 0.6; font-size: 10px; }

/* ---------- placeholders (hover fan + unfold) ---------- */
.placeholders { position: fixed; z-index: 40; pointer-events: none; visibility: hidden; }
.placeholders__img-wrap {
	position: absolute;
	inset: 0;
	overflow: hidden;
	box-shadow: 0 30px 60px -20px rgb(0 0 0 / 35%);
	transform-origin: 50% 100%;
}
.placeholders__img-wrap img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- specification ---------- */
.specsheet { padding: clamp(80px, 12vw, 180px) var(--gutter); display: grid; gap: 56px; }
.specsheet__title { margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(30px, 4.6vw, 76px); font-weight: 300; line-height: 1; letter-spacing: -0.02em; max-width: 12em; }
.specsheet__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gutter); }
.specsheet__list li { border-top: 1px solid var(--ink); padding-top: 18px; }
.specsheet__list .mono { color: var(--color-accent); }
.specsheet__list h3 { font-family: var(--serif); font-weight: 400; font-size: 22px; margin: 14px 0 10px; letter-spacing: -0.01em; }
.specsheet__list p { margin: 0; color: var(--ink-2); line-height: 1.6; font-size: 13px; max-width: 34em; }
@media (max-width: 860px) { .specsheet__list { grid-template-columns: 1fr; } }
.specsheet__cta { display: flex; gap: 14px; flex-wrap: wrap; }
.link-btn { display: inline-flex; align-items: center; gap: 8px; padding: 14px 22px; border-radius: 999px; background: var(--ink); color: var(--paper); text-decoration: none; font-size: 13px; transition: background 0.3s; }
.link-btn:hover { background: var(--color-accent); }
.link-btn--ghost { background: transparent; color: inherit; border: 1px solid currentColor; }
.link-btn--ghost:hover { background: transparent; color: var(--color-accent); }
.foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 24px var(--gutter); border-top: 1px solid var(--line); color: var(--ink-2); }

/* ---------- slider ---------- */
.slider {
	position: fixed;
	inset: 0;
	z-index: 30;
	background: var(--paper);
	visibility: hidden;
	opacity: 0;
	display: flex;
	align-items: center;
	overflow: hidden;
	/* the slider handles every touch itself (drag + snap); without this Android cancels the drag */
	touch-action: none;
}
.slider__head { position: absolute; top: 76px; left: var(--gutter); right: var(--gutter); display: flex; justify-content: space-between; color: var(--ink-2); }
.slider__count { color: var(--ink); font-size: 13px; }
.slider__count .js-current { color: var(--color-accent); }
.slider__close { position: absolute; z-index: 5; right: var(--gutter); bottom: 110px; width: 72px; height: 72px; }
.slider__close svg { width: 100%; height: 100%; overflow: visible; fill: none; stroke: var(--ink); stroke-width: 1; }
.slider__close:hover svg { stroke: var(--color-accent); }

.slider__track {
	display: flex;
	gap: 4.2vw;
	padding: 0 8.33vw;
	cursor: grab;
	will-change: transform;
	user-select: none;
}
.is-dragging .slider__track { cursor: grabbing; }
.slide { flex: 0 0 auto; width: clamp(240px, 26vw, 420px); position: relative; }
.slide__img { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: var(--paper-2); }
.slide__img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scale(1.18); transform-origin: left center; will-change: transform; pointer-events: none; }
.slide__meta { display: flex; justify-content: space-between; margin-top: 14px; color: var(--ink-2); }
.slide__heading-wrap { overflow: hidden; }
.slide__heading { margin: 6px 0 0; font-family: var(--serif); font-weight: 400; font-size: clamp(18px, 1.55vw, 26px); line-height: 1.1; letter-spacing: -0.015em; transform-origin: left bottom; white-space: nowrap; }
.slide__btn-wrap { overflow: hidden; margin-top: 12px; }
.slide__btn { display: inline-flex; align-items: center; gap: 10px; padding-bottom: 3px; border-bottom: 1px solid var(--ink); font-size: 14px; }
.slide__btn svg { width: 16px; stroke: currentColor; fill: none; transition: transform 0.5s var(--ease); }
.slide__btn:hover { color: var(--color-accent); border-color: var(--color-accent); }
.slide__btn:hover svg { transform: translateX(5px); }
.slide__open { position: absolute; inset: 0; z-index: 1; }
.slide:hover .slide__img img { filter: contrast(1.05); }

.slider__scale { position: absolute; left: 8.33vw; right: 8.33vw; bottom: 44px; cursor: pointer; }
.slider__ticks { display: flex; justify-content: space-between; height: 12px; align-items: end; }
.slider__ticks button { width: 9px; height: 12px; display: flex; justify-content: center; align-items: end; }
.slider__ticks button::before { content: ''; width: 1px; height: 6px; background: var(--ink-2); transition: height 0.3s, background 0.3s; }
.slider__ticks button:nth-child(5n+1)::before { height: 12px; }
.slider__ticks button:hover::before, .slider__ticks button.is-current::before { background: var(--color-accent); height: 12px; }
.slider__bar { height: 1px; background: var(--line); margin-top: 6px; overflow: hidden; }
.slider__bar i { display: block; height: 100%; background: var(--ink); transform: scaleX(0); transform-origin: left; }
@media (max-width: 760px) {
	.slider__track { padding: 0 var(--gutter); gap: 18px; }
	.slide { width: 72vw; }
	.slider__close { width: 56px; height: 56px; bottom: auto; top: 100px; }
	.slider__head { top: 70px; }
	.slider__head > span:first-child { display: none; }
	.slider__ticks button { width: 6px; }
}

/* ---------- cover page transition ---------- */
.overlay { position: fixed; inset: 0; z-index: 60; display: grid; grid-template-rows: 1fr 1fr; pointer-events: none; }
.overlay__row { background: var(--night); transform: scaleY(0); will-change: transform; }
.overlay__row:first-child { transform-origin: 50% 0%; }
.overlay__row:last-child { transform-origin: 50% 100%; }

.preview {
	position: fixed;
	inset: 0;
	z-index: 70;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	touch-action: pan-y;
	background: var(--night);
	color: var(--night-ink);
	visibility: hidden;
	opacity: 0;
}
.preview.is-current { visibility: visible; opacity: 1; }
.preview__inner {
	position: relative;
	min-height: 100svh;
	padding: 96px var(--gutter) 48px;
	display: grid;
	grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
	grid-template-rows: auto 1fr auto;
	column-gap: var(--gutter);
	row-gap: 32px;
}
.preview__back { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; stroke: var(--night-ink); justify-self: start; }
.preview__back svg { fill: none; }
.preview__back:hover { stroke: var(--color-accent); color: var(--color-accent); }
.preview__img { grid-column: 1; grid-row: 2 / span 2; position: relative; aspect-ratio: 4 / 5; max-height: calc(100svh - 170px); overflow: hidden; transform: translateY(-101%); will-change: transform; }
.preview__img-inner { width: 100%; height: 100%; background-size: cover; background-position: 50% 50%; transform: translateY(101%); will-change: transform; }
.preview__head { grid-column: 2; grid-row: 2; align-self: start; display: grid; gap: 14px; }
.preview__head .mono { color: rgb(242 241 238 / 55%); }
.preview__title { margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(36px, 5vw, 92px); font-weight: 300; line-height: 1; letter-spacing: -0.025em; }
.preview__kind { font-family: var(--serif); font-style: italic; font-weight: 300; font-size: clamp(16px, 1.5vw, 24px); color: rgb(242 241 238 / 75%); }
.preview__cols { grid-column: 2; grid-row: 3; align-self: end; display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px var(--gutter); border-top: 1px solid rgb(242 241 238 / 18%); padding-top: 22px; }
.preview__col h3 { margin: 0 0 8px; color: var(--color-accent); font-weight: 400; }
.preview__col p { margin: 0; font-size: 13px; line-height: 1.45; color: rgb(242 241 238 / 85%); }
.swatches { display: flex; gap: 6px; }
.swatch { flex: 1; min-width: 0; }
.swatch span { overflow-wrap: anywhere; }
.preview { overflow-x: hidden; }
.swatch i { display: block; height: 40px; border: 1px solid rgb(242 241 238 / 14%); }
.swatch span { display: block; margin-top: 6px; font-family: var(--mono); font-size: 9px; letter-spacing: 0.04em; text-transform: uppercase; color: rgb(242 241 238 / 55%); }
.oh { overflow: hidden; display: block; }
.oh__inner { display: inline-block; will-change: transform; }

.sheets { padding: 40px var(--gutter) 64px; border-top: 1px solid rgb(242 241 238 / 12%); }
.sheets__head { display: flex; justify-content: space-between; margin-bottom: 24px; color: rgb(242 241 238 / 55%); }
.sheets__head h3 { margin: 0; font-weight: 400; color: var(--night-ink); }
.sheets__grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 40px var(--gutter); }
.sheets__grid li { counter-increment: none; }
.sheets__grid figure { margin: 0; }
.sheets__grid img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; background: #1b1b1b; }
.sheets__grid figcaption { margin-top: 8px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.04em; text-transform: uppercase; color: rgb(242 241 238 / 55%); display: flex; justify-content: space-between; }
.sheets__nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 48px; flex-wrap: wrap; }
.preview .link-btn { background: var(--night-ink); color: var(--night); }
.preview .link-btn:hover { background: var(--color-accent); color: var(--night-ink); }
.preview .link-btn--ghost { background: transparent; color: var(--night-ink); }
.preview .link-btn--ghost:hover { color: var(--color-accent); background: transparent; }

@media (max-width: 900px) {
	.preview__inner { grid-template-columns: 1fr; }
	.preview__img { grid-column: 1; grid-row: auto; max-height: none; }
	.preview__head, .preview__cols { grid-column: 1; grid-row: auto; }
	.sheets__grid { grid-template-columns: repeat(2, 1fr); gap: 28px var(--gutter); }
}

.is-locked { overflow: hidden; }

/* sticky Back at the bottom of a design's detail page */
.preview__dock {
	position: sticky;
	bottom: 0;
	z-index: 5;
	display: flex;
	justify-content: center;
	padding: 12px var(--gutter) calc(14px + env(safe-area-inset-bottom));
	background: linear-gradient(to top, var(--night) 45%, transparent);
	pointer-events: none;
}
.preview__dock-btn {
	pointer-events: auto;
	padding: 13px 22px;
	border-radius: 999px;
	background: var(--night-ink);
	color: var(--night);
	font-family: var(--mono);
	font-size: 12px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	box-shadow: 0 6px 24px rgb(0 0 0 / 35%);
	transition: background 0.3s, color 0.3s;
}
.preview__dock-btn:hover { background: var(--color-accent); color: var(--night-ink); }
@media (min-width: 901px) { .preview__dock { justify-content: flex-start; } }
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition-duration: 0.01ms !important; }
}
@media (max-width: 560px) { .sheets__grid { grid-template-columns: 1fr; } }

/* the big line: two lines on wide screens, three much larger lines on phones */
.hero__big--narrow { display: none; }
@media (max-width: 640px) {
	.hero__big--wide { display: none; }
	.hero__big--narrow {
		display: block;
		/* "FUNCTION()" (10 glyphs at ~0.6em) fills the column; capped by height so it still fits one screen */
		font-size: min(calc((100vw - 2 * var(--gutter)) / 6.1), 11vh);
		line-height: 0.9;
		letter-spacing: -0.03em;
	}
	.hero__big--narrow p:nth-child(2) { font-style: normal; padding-left: 0; }
	.hero__big--narrow p:nth-child(3) { font-style: italic; }
}
