/* ──────────────────────────────────────────────────────────────
   Art Williams — portfolio
   One stylesheet for every page. No frameworks, no build step.
   ────────────────────────────────────────────────────────────── */

/* AW Sans = Latin subset of Pretendard (SIL OFL). See ../fonts/OFL.txt */
@font-face {
	font-family: "AW Sans";
	src: url("../fonts/aw-sans.woff2") format("woff2");
	font-weight: 45 930;
	font-style: normal;
	font-display: swap;
}

/* Arial tuned to AW Sans metrics, so the font swap doesn't move anything */
@font-face {
	font-family: "AW Sans Fallback";
	src: local("Arial"), local("ArialMT"), local("Helvetica Neue"), local("Helvetica");
	size-adjust: 101.58%;
	ascent-override: 93.73%;
	descent-override: 23.74%;
	line-gap-override: 0%;
}

:root {
	--bg: #0e0e0e;
	--fg: #fff;
	--fg-2: rgb(255 255 255 / 0.66);
	--fg-3: rgb(255 255 255 / 0.52);
	--line: rgb(255 255 255 / 0.14);
	--panel: #161616;

	--font: "AW Sans", "AW Sans Fallback", system-ui, -apple-system, "Segoe UI", sans-serif;
	--gutter: clamp(16px, 2.4vw, 36px);
	--pad: clamp(16px, 1.7vw, 28px);

	--ease-out: cubic-bezier(0.16, 1, 0.3, 1);
	--ease-in-out: cubic-bezier(0.76, 0, 0.24, 1);
	--ease-in: cubic-bezier(0.55, 0, 0.75, 0);

	color-scheme: dark;
}

/* ── Base ─────────────────────────────────────────────────── */

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

html {
	background: var(--bg);
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-padding-top: 72px; /* anchors and focused elements clear the fixed header */
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--fg);
	font: 400 16px/1.5 var(--font);
	letter-spacing: -0.006em;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, p, dl, dd, figure, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
img, picture, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

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

.vh {
	position: absolute !important;
	width: 1px; height: 1px;
	margin: -1px; padding: 0; border: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* Underline that draws in on hover */
.u {
	background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
	padding-bottom: 2px;
	transition: background-size 0.5s var(--ease-out);
}
.u:hover, .u:focus-visible { background-size: 100% 1px; }

/* ── Header ───────────────────────────────────────────────── */

.site-header {
	position: fixed;
	inset: 0 0 auto;
	z-index: 20;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	padding: clamp(16px, 1.6vw, 26px) var(--gutter);
	font-size: 14px;
	font-weight: 500;
	line-height: 1;
	pointer-events: none;
	view-transition-name: site-header;
}
/* Frosted bar behind the header. Over the full-bleed hero / columns it stays hidden
   (they carry their own top scrim); it fades in as they scroll away. Browsers without
   scroll-driven animations simply keep the bar. */
.site-header::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: rgb(14 14 14 / 0.8);
	-webkit-backdrop-filter: blur(20px) saturate(1.4);
	backdrop-filter: blur(20px) saturate(1.4);
	box-shadow: 0 1px 0 rgb(255 255 255 / 0.06);
}
@supports (animation-timeline: scroll()) {
	.site-header::before {
		opacity: 0;
		animation: header-bar linear both;
		animation-timeline: scroll(root);
		animation-range: calc(100svh - 240px) calc(100svh - 140px);
	}
}
@keyframes header-bar { to { opacity: 1; } }
/* padding gives a >= 24px touch target without moving anything */
.site-header a {
	pointer-events: auto;
	padding: 8px 4px;
	margin: -8px -4px;
	background-origin: content-box;
}

.brand {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-size: 15px;
	font-weight: 600;
	letter-spacing: -0.015em;
}
.brand__mark { width: 20px; height: 16px; fill: currentColor; }

.site-nav { display: flex; gap: clamp(18px, 2vw, 32px); }

/* ── Home: intro ──────────────────────────────────────────── */
/* Plays once per session (see the inline script in <head>).
   Pure CSS, so it also runs — and ends — without JavaScript. */

.intro {
	position: fixed;
	inset: 0;
	z-index: 100;
	display: flex;
	align-items: center;
	padding: 0 var(--gutter);
	animation: intro-hide 0s linear 3.1s forwards;
}
.intro-seen .intro { display: none; }
.intro-skip .intro {
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.4s ease, visibility 0s linear 0.4s;
}

.intro__strips { position: absolute; inset: 0; display: flex; }
.intro__strips i {
	flex: 1 1 0;
	margin-right: -1px; /* no hairline seams between strips */
	background: var(--bg);
	transform-origin: 50% 0;
	animation: strip-up 0.95s var(--ease-in-out) forwards;
	animation-delay: calc(2s + var(--i) * 70ms);
}

.intro__body {
	position: relative;
	width: 100%;
	animation: intro-out 0.5s var(--ease-in) 1.75s forwards;
}

.intro__line {
	color: var(--fg-2);
	font-size: clamp(22px, 2.05vw, 32px);
	font-weight: 500;
	line-height: 1.3;
	letter-spacing: -0.024em;
}
.intro__line b { color: var(--fg); font-weight: 500; }
.intro__line .w {
	display: inline-block;
	overflow: hidden;
	vertical-align: top;
	padding-bottom: 0.1em;
	margin-bottom: -0.1em;
}
.intro__line .w > span {
	display: inline-block;
	transform: translateY(110%);
	animation: word-in 1s var(--ease-out) forwards;
	animation-delay: calc(0.12s + var(--i) * 30ms);
}

.intro__bar {
	position: relative;
	height: 1px;
	margin-top: clamp(20px, 2.4vw, 32px);
	overflow: hidden;
	background: var(--line);
}
.intro__bar::after {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--fg);
	transform: scaleX(0);
	transform-origin: 0 50%;
	animation: bar 1.45s var(--ease-in-out) 0.25s forwards;
}

/* Home page elements settle in as the strips lift */
html:not(.intro-seen):not(.intro-skip) .home .col__media {
	animation: settle 1.8s var(--ease-out) backwards;
	animation-delay: calc(2s + var(--i) * 70ms);
}
html:not(.intro-seen):not(.intro-skip) .home :is(.site-header, .col__label) {
	animation: fade-in 0.9s ease 2.6s backwards;
}

@keyframes intro-hide { to { visibility: hidden; } }
@keyframes intro-out  { to { opacity: 0; transform: translateY(-12px); } }
@keyframes strip-up   { to { transform: scaleY(0); } }
@keyframes word-in    { to { transform: none; } }
@keyframes bar        { to { transform: scaleX(1); } }
@keyframes settle     { from { transform: scale(1.16); } }
@keyframes fade-in    { from { opacity: 0; } }
@keyframes rise       { from { opacity: 0; transform: translateY(18px); } }

/* ── Home: project columns ────────────────────────────────── */

.work {
	display: flex;
	height: 100vh;
	height: 100svh;
	min-height: 520px;
}

.work__item {
	position: relative;
	flex: 1 1 0;
	min-width: 0;
	overflow: hidden;
	transition: flex-grow 1s var(--ease-out);
}
.work__item:has(> .col[open]) { flex-grow: 4.2; }

@media (hover: hover) {
	.work__item:not(:has(> .col[open])):hover { flex-grow: 1.35; }
}

.col { position: absolute; inset: 0; }

.col__trigger {
	position: absolute;
	inset: 0;
	display: block;
	list-style: none;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}
.col__trigger::-webkit-details-marker { display: none; }
.col__trigger:focus-visible { outline-offset: -6px; }

/* dim layer */
.col__trigger::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	background: #000;
	opacity: 0.2;
	transition: opacity 0.7s var(--ease-out);
}
/* scrims: top for the header, bottom for labels */
.col__trigger::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	background:
		linear-gradient(rgb(0 0 0 / 0.45), rgb(0 0 0 / 0) 160px),
		linear-gradient(to top, rgb(0 0 0 / 0.6), rgb(0 0 0 / 0) 48%);
}
.col[open] .col__trigger::before { opacity: 0; }

@media (hover: hover) {
	.col__trigger:hover::before { opacity: 0; }
	.col__trigger:hover .col__media img { transform: scale(1.035); }
}

.col__media,
.col__media img,
.hero__media,
.hero__media img,
.next__media,
.next__media img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}
.col__media, .hero__media, .next__media {
	overflow: hidden;
	background: var(--panel);
	view-transition-class: cover;
}
.col__media img, .hero__media img, .next__media img {
	object-fit: cover;
	object-position: var(--focus, 50% 50%);
}
.col__media img { transition: transform 1.4s var(--ease-out); }

.col__label {
	position: absolute;
	z-index: 2;
	left: var(--pad);
	right: var(--pad);
	bottom: var(--pad);
	display: flex;
	align-items: baseline;
	gap: 0.8em;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.2;
	white-space: nowrap;
	transition: opacity 0.35s ease, transform 0.6s var(--ease-out);
}
.col__num { color: var(--fg-2); font-size: 12px; font-variant-numeric: tabular-nums; }
.col__name { overflow: hidden; text-overflow: ellipsis; }
.col[open] .col__label { opacity: 0; transform: translateY(10px); }

.col__panel {
	position: absolute;
	inset: 0;
	z-index: 3;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: flex-end;
	padding: var(--pad);
}
.col__panel:focus-visible { outline-offset: -6px; }
.col__panel > * { animation: rise 0.9s var(--ease-out) backwards; }
.col__panel > :nth-child(1) { animation-delay: 0.28s; }
.col__panel > :nth-child(2) { animation-delay: 0.36s; }
.col__panel > :nth-child(3) { animation-delay: 0.44s; }

.col__title {
	font-size: clamp(40px, 5.4vw, 96px);
	font-weight: 600;
	line-height: 0.92;
	letter-spacing: -0.045em;
	white-space: nowrap;
	margin-left: -0.03em;
}
.col__role { margin-top: 14px; color: var(--fg-2); font-size: 15px; }
.col__cta {
	display: inline-flex;
	align-items: center;
	gap: 0.6em;
	margin-top: 24px;
	padding-bottom: 5px;
	border-bottom: 1px solid var(--fg);
	font-size: 15px;
	font-weight: 500;
}
.col__cta-arrow { transition: transform 0.5s var(--ease-out); }
.col__panel:hover .col__cta-arrow { transform: translateX(5px); }

@media (max-width: 699px) {
	.work { flex-direction: column; }
	.work__item:has(> .col[open]) { flex-grow: 3; }
}

/* ── Home: info ───────────────────────────────────────────── */

.info {
	display: grid;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	gap: 56px var(--gutter);
	padding: clamp(88px, 12vw, 200px) var(--gutter) clamp(72px, 9vw, 150px);
}

.label {
	color: var(--fg-3);
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0;
}

.info__title { grid-column: 1 / -1; }

.info__lead {
	grid-column: 1 / -1;
	max-width: 21em;
	font-size: clamp(28px, 3.6vw, 56px);
	font-weight: 500;
	line-height: 1.08;
	letter-spacing: -0.035em;
}

.info__col { grid-column: span 12; display: grid; align-content: start; gap: 14px; font-size: 16px; }
.info__col p { max-width: 34em; color: var(--fg-2); }
.info__col ul { display: grid; gap: 6px; }
.info__col li { color: var(--fg-2); }
.info__col a { color: var(--fg); }

@media (min-width: 700px) {
	.info__col { grid-column: span 6; }
}
@media (min-width: 1100px) {
	.info__col--about    { grid-column: 1 / span 5; }
	.info__col--services { grid-column: 7 / span 3; }
	.info__col--contact  { grid-column: 10 / span 3; }
}

/* ── Footer ───────────────────────────────────────────────── */

.site-footer {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 20px 48px;
	padding: 28px var(--gutter);
	border-top: 1px solid var(--line);
	color: var(--fg-3);
	font-size: 13px;
}
.site-footer__other,
.site-footer__other ul,
.site-footer__end,
.site-footer nav {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 10px 24px;
}
.site-footer__other ul { column-gap: 20px; }
.site-footer__label { font-size: inherit; font-weight: inherit; }
.site-footer a { color: var(--fg); }

@media (max-width: 699px) {
	.site-footer__other { flex-direction: column; }
}

/* ── Project page ─────────────────────────────────────────── */

.hero {
	position: relative;
	height: 100vh;
	height: 100svh;
	min-height: 520px;
	overflow: hidden;
}
.hero__media::after,
.next__media::after {
	content: "";
	position: absolute;
	inset: 0;
	background:
		linear-gradient(rgb(0 0 0 / 0.45), rgb(0 0 0 / 0) 160px),
		linear-gradient(to top, rgb(0 0 0 / 0.62), rgb(0 0 0 / 0) 55%);
}

.hero__text {
	position: absolute;
	z-index: 2;
	left: var(--gutter);
	right: var(--gutter);
	bottom: var(--gutter);
	display: grid;
	gap: 22px;
	view-transition-class: title;
}
.hero__text > * { animation: rise 1s var(--ease-out) backwards; }
.hero__text > :nth-child(1) { animation-delay: 0.2s; }
.hero__text > :nth-child(2) { animation-delay: 0.3s; }

.hero__title {
	font-size: clamp(64px, 13vw, 220px);
	font-weight: 600;
	line-height: 0.82;
	letter-spacing: -0.055em;
	margin-left: -0.04em;
	overflow-wrap: anywhere;
}
.hero__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 28px;
	color: var(--fg-2);
	font-size: 15px;
}
.hero__meta span:first-child { color: var(--fg); font-variant-numeric: tabular-nums; }

.facts {
	display: grid;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	gap: 48px var(--gutter);
	padding: clamp(72px, 10vw, 160px) var(--gutter);
}
.facts__summary {
	grid-column: 1 / -1;
	max-width: 22em;
	font-size: clamp(26px, 2.8vw, 44px);
	font-weight: 500;
	line-height: 1.12;
	letter-spacing: -0.03em;
}
.facts__list { grid-column: 1 / -1; border-top: 1px solid var(--line); }
.facts__list > div {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
	gap: 16px;
	padding: 14px 0;
	border-bottom: 1px solid var(--line);
	font-size: 15px;
}
.facts__list dt { color: var(--fg-3); }

@media (min-width: 1000px) {
	.facts__summary { grid-column: 1 / span 7; }
	.facts__list { grid-column: 9 / -1; align-self: start; }
}

/* Screens: desktop homepage full width, collection + product pages side by side,
   then the three mobile screens on a panel (a swipeable row on phones). */
.gallery {
	display: grid;
	gap: clamp(40px, 5vw, 72px) var(--gutter);
	padding: 0 var(--gutter) clamp(72px, 10vw, 160px);
}
.shot img,
.phone img {
	width: 100%;
	height: auto;
	background: var(--panel);
}
.shot img { border-radius: 6px; }
.shot figcaption,
.phone figcaption {
	margin-top: 12px;
	color: var(--fg-3);
	font-size: 13px;
}

.phones {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 320px));
	justify-content: center;
	gap: clamp(16px, 4vw, 72px);
	padding: clamp(40px, 7vw, 112px) clamp(24px, 6vw, 112px);
	border-radius: 6px;
	background: var(--panel);
}
.phone img { border-radius: clamp(12px, 1.5vw, 22px); }
.phone figcaption { text-align: center; }
.phones:focus-visible { outline-offset: 4px; }

@media (min-width: 900px) {
	.gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.shot--wide, .phones { grid-column: 1 / -1; }
}
@media (max-width: 699px) {
	.phones {
		display: flex;
		justify-content: flex-start;
		gap: 16px;
		margin: 0 calc(var(--gutter) * -1);
		padding: 32px var(--gutter);
		border-radius: 0;
		overflow-x: auto;
		overscroll-behavior-x: contain;
		scroll-snap-type: x mandatory;
		scroll-padding: 0 var(--gutter);
		scrollbar-width: none;
	}
	.phones::-webkit-scrollbar { display: none; }
	.phone { flex: 0 0 66vw; scroll-snap-align: start; }
}

.next {
	position: relative;
	display: block;
	height: 72vh;
	min-height: 420px;
	overflow: hidden;
}
.next__media img { transition: transform 1.4s var(--ease-out); }
.next__text {
	position: absolute;
	z-index: 2;
	left: var(--gutter);
	right: var(--gutter);
	bottom: var(--gutter);
	display: grid;
	gap: 18px;
}
.next__title {
	font-size: clamp(56px, 10vw, 168px);
	font-weight: 600;
	line-height: 0.84;
	letter-spacing: -0.055em;
	margin-left: -0.04em;
}
.next__label { display: flex; gap: 0.6em; color: var(--fg-2); font-size: 15px; }
.next__arrow { transition: transform 0.5s var(--ease-out); }
@media (hover: hover) {
	.next:hover .next__media img { transform: scale(1.03); }
	.next:hover .next__arrow { transform: translateX(5px); }
}
.next:focus-visible { outline-offset: -6px; }

/* ── Page transitions (Chrome / Edge / Safari 18.2+) ─────── */
/* The chosen column's image morphs into the project hero.   */

@view-transition { navigation: auto; }

::view-transition-group(*) {
	animation-duration: 0.85s;
	animation-timing-function: var(--ease-in-out);
}
::view-transition-old(*.cover),
::view-transition-new(*.cover) {
	height: 100%;
	object-fit: cover;
}
::view-transition-group(*.title) { z-index: 5; }
::view-transition-group(site-header) { z-index: 10; }
::view-transition-old(root),
::view-transition-new(root) { animation-duration: 0.45s; }

/* ── Reduced motion ───────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
	@view-transition { navigation: none; }

	*, *::before, *::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}
