/*
	Atelier Glass — apps hub and privacy documents.

	One sheet, two jobs:

	  1. The apps catalogue page (/apps/), whose tiles and detail sections are
	     injected by apps/apps.js.
	  2. The standalone privacy policies (/apps/<slug>/privacy/, /privacy.html),
	     which already share a class vocabulary — .privacy-hero, .summary-card,
	     .policy-section, .policy-table. Those pages need NO markup changes:
	     drop their <link> to main.css and their inline <style>, point at this
	     file, and they take on the new look while keeping their URLs.

	Self-contained on purpose. It does not extend main.css, so the old template
	can keep serving anything that still needs it.
*/

:root {
	--bg: #0b0c0e;
	--bg-raised: #101216;
	--gold: #b99c45;
	--gold-light: #d9c07f;
	--gold-pale: #e8d49a;
	--text: #f2f1ee;
	--text-dim: #b8bcc0;
	--text-muted: #8b9096;
	--text-faint: #5f656b;
	--hairline: rgba(242, 241, 238, 0.13);
	--glass: rgba(255, 255, 255, 0.05);
	--glass-edge: rgba(255, 255, 255, 0.11);

	--serif: Newsreader, Georgia, "Times New Roman", serif;
	--sans: Jost, "Helvetica Neue", Helvetica, Arial, sans-serif;
	--mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

	--gutter: 60px;
	--maxw: 1400px;
	--readable: 78ch;
}

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

html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--sans);
	font-weight: 300;
	font-size: 16px;
	line-height: 1.75;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}

a {
	color: var(--gold-light);
	text-decoration: none;
	transition: color 0.2s ease;
}

a:hover {
	color: var(--gold-pale);
}

img {
	max-width: 100%;
}

.wrap,
.content {
	max-width: var(--maxw);
	margin: 0 auto;
	padding: 0 var(--gutter);
}

/* ---------- Shared site header / footer ---------- */

#header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	padding: 24px var(--gutter);
	max-width: var(--maxw);
	margin: 0 auto;
	border-bottom: 1px solid var(--hairline);
}

#header h1 {
	margin: 0;
	font-size: 0;
}

#header h1 a {
	display: inline-flex;
	align-items: center;
	gap: 13px;
	font-family: var(--mono);
	font-size: 11px;
	letter-spacing: 0.24em;
	text-transform: uppercase;
	color: var(--text);
}

#header h1 img {
	width: 36px;
	height: auto;
	display: block;
}

#header nav ul {
	display: flex;
	align-items: center;
	gap: 28px;
	list-style: none;
	margin: 0;
	padding: 0;
}

#header nav a {
	font-family: var(--mono);
	font-size: 11px;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--text-muted);
}

#header nav a:hover {
	color: var(--text);
}

#footer {
	border-top: 1px solid var(--hairline);
	margin-top: 96px;
	padding: 28px var(--gutter);
	max-width: var(--maxw);
	margin-left: auto;
	margin-right: auto;
}

#footer .menu {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	flex-wrap: wrap;
	list-style: none;
	margin: 0;
	padding: 0;
	font-family: var(--mono);
	font-size: 10px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--text-faint);
}

#footer a {
	color: var(--text-faint);
}

#footer a:hover {
	color: var(--gold-light);
}

/* ---------- Section scaffolding ---------- */

.section-head {
	display: flex;
	align-items: baseline;
	gap: 20px;
	margin-bottom: 36px;
}

.section-head .num {
	font-family: var(--mono);
	font-size: 11px;
	color: var(--gold);
}

.section-head h2 {
	margin: 0;
	font-family: var(--serif);
	font-weight: 200;
	font-size: clamp(28px, 3.2vw, 38px);
	letter-spacing: -0.01em;
	color: #fff;
}

.section-head .count {
	font-family: var(--mono);
	font-size: 11px;
	color: var(--text-muted);
}

.section-head .rule {
	flex: 1;
	height: 1px;
	background: var(--hairline);
}

.btn-gold {
	display: inline-block;
	background: var(--gold);
	color: var(--bg);
	padding: 13px 26px;
	font-family: var(--mono);
	font-size: 11px;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	transition: background 0.2s ease;
}

.btn-gold:hover {
	background: var(--gold-pale);
	color: var(--bg);
}

.btn-outline {
	display: inline-block;
	border: 1px solid var(--gold);
	color: var(--gold-light);
	padding: 13px 26px;
	font-family: var(--mono);
	font-size: 11px;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	transition: background 0.2s ease, color 0.2s ease;
}

.btn-outline:hover {
	background: var(--gold);
	color: var(--bg);
}

/* ================================================================
   APPS HUB
   ================================================================ */

.apps-hero {
	position: relative;
	overflow: hidden;
	padding: clamp(56px, 7vw, 88px) 0 clamp(48px, 6vw, 72px);
}

.apps-hero-bg {
	/* Overscanned so the blur has material to bleed into at the edges. */
	position: absolute;
	inset: -80px;
	/* A wall built from the real app icons — see tools/make-apps-wall.sh.
	   Blurred hard on purpose: the dock in front already shows the icons
	   sharply, so this stays an atmospheric wash of their colour rather than
	   a second, competing set of icons. */
	background-image: url(/assets/apps-wall.jpg);
	background-size: 900px auto;
	background-position: center center;
	background-repeat: repeat;
	opacity: 0.4;
	filter: blur(34px) saturate(0.9);
}

.apps-hero::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(11, 12, 14, 0.86) 0%, rgba(11, 12, 14, 0.78) 38%, rgba(11, 12, 14, 0.94) 74%, var(--bg) 100%);
}

.apps-hero-content {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 34px;
	text-align: center;
}

.apps-hero-copy {
	display: flex;
	flex-direction: column;
	gap: 14px;
	transition: opacity 0.18s ease;
}

.apps-hero-copy.is-changing {
	opacity: 0;
}

.apps-kicker {
	margin: 0;
	font-family: var(--mono);
	font-size: 11px;
	letter-spacing: 0.34em;
	text-transform: uppercase;
	color: var(--gold);
}

.apps-hero-copy h2 {
	margin: 0;
	font-family: var(--serif);
	font-weight: 200;
	font-size: clamp(34px, 4.6vw, 56px);
	line-height: 1.08;
	letter-spacing: -0.02em;
	color: #fff;
}

.apps-hero-copy p {
	margin: 0;
	font-size: 16px;
	color: var(--text-dim);
}

/* Rotating icon dock */
.apps-hero-dock {
	position: relative;
	height: 132px;
	width: 100%;
	max-width: 620px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.app-dock-item {
	position: absolute;
	left: 50%;
	top: 50%;
	width: 86px;
	height: 86px;
	margin: -43px 0 0 -43px;
	transition: transform 0.55s cubic-bezier(0.2, 0.7, 0.3, 1), opacity 0.55s ease, filter 0.55s ease;
	transform: translateX(calc(var(--dock-offset, 0) * 104px)) scale(0.66);
	opacity: 0;
	filter: grayscale(0.3) brightness(0.86);
	z-index: 0;
	pointer-events: none;
}

.app-dock-item img {
	width: 100%;
	height: 100%;
	border-radius: 22%;
	display: block;
	border: 1px solid var(--glass-edge);
}

.app-dock-item[data-position="-2"],
.app-dock-item[data-position="2"] {
	opacity: 0.5;
	filter: grayscale(0.3) brightness(0.86);
	transform: translateX(calc(var(--dock-offset, 0) * 104px)) scale(0.68);
	pointer-events: auto;
	z-index: 1;
}

.app-dock-item[data-position="-1"],
.app-dock-item[data-position="1"] {
	opacity: 0.88;
	filter: grayscale(0.12) brightness(0.95);
	transform: translateX(calc(var(--dock-offset, 0) * 104px)) scale(0.82);
	pointer-events: auto;
	z-index: 2;
}

.app-dock-item[data-position="0"] {
	opacity: 1;
	transform: translateX(0) scale(1.18);
	filter: none;
	pointer-events: auto;
	z-index: 3;
}

.app-dock-item[data-position="0"] img {
	border-color: rgba(217, 192, 127, 0.5);
	box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
}

.app-dock-item[data-position="hidden"] {
	opacity: 0;
	pointer-events: none;
}

/* Overview + tile grid */
.apps-overview {
	padding: clamp(56px, 7vw, 88px) 0 0;
}

.apps-overview header {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin-bottom: 28px;
}

.apps-overview header h2 {
	margin: 0;
	font-family: var(--serif);
	font-weight: 200;
	font-size: clamp(30px, 3.6vw, 42px);
	letter-spacing: -0.01em;
	color: #fff;
}

.apps-overview header p {
	margin: 0;
	color: var(--text-muted);
	max-width: 62ch;
	font-size: 15px;
}

.apps-toolbar {
	margin-bottom: 28px;
}

.apps-grid-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
	gap: 14px;
}

.app-tile {
	background: var(--glass);
	backdrop-filter: blur(18px);
	-webkit-backdrop-filter: blur(18px);
	border: 1px solid var(--glass-edge);
	border-top-color: rgba(217, 192, 127, 0.34);
	padding: 18px;
	display: flex;
	align-items: center;
	gap: 14px;
	color: var(--text);
	transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.app-tile:hover {
	background: rgba(255, 255, 255, 0.08);
	border-color: rgba(217, 192, 127, 0.5);
	transform: translateY(-2px);
	color: var(--text);
}

.app-tile img {
	width: 48px;
	height: 48px;
	border-radius: 12px;
	display: block;
	flex-shrink: 0;
}

.app-tile strong {
	display: block;
	font-weight: 400;
	font-size: 13px;
	line-height: 1.3;
	color: #fff;
}

.app-tile span {
	display: block;
	font-family: var(--mono);
	font-size: 9px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--text-muted);
	margin-top: 4px;
}

/* Privacy note band */
.apps-policy-note {
	padding: clamp(56px, 7vw, 88px) 0 0;
}

.apps-policy-note h2 {
	margin: 0 0 12px;
	font-family: var(--serif);
	font-weight: 200;
	font-size: clamp(26px, 3vw, 34px);
	color: #fff;
}

.apps-policy-note p {
	margin: 0;
	color: var(--text-muted);
	max-width: var(--readable);
	font-size: 15px;
}

/* ---------- Per-app detail ---------- */

.apps-detail-list {
	display: flex;
	flex-direction: column;
}

.app-detail {
	padding: clamp(48px, 6vw, 76px) 0 0;
	scroll-margin-top: 24px;
}

.app-detail-header {
	display: grid;
	grid-template-columns: 96px minmax(0, 1fr);
	gap: 28px;
	align-items: start;
	padding-bottom: 32px;
	border-bottom: 1px solid var(--hairline);
}

.app-detail-icon img {
	width: 96px;
	height: 96px;
	border-radius: 22%;
	display: block;
	border: 1px solid var(--glass-edge);
}

.app-meta {
	margin: 0 0 10px;
	font-family: var(--mono);
	font-size: 10px;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--gold);
}

.app-detail-header h2 {
	margin: 0 0 8px;
	font-family: var(--serif);
	font-weight: 200;
	font-size: clamp(30px, 3.8vw, 44px);
	line-height: 1.1;
	letter-spacing: -0.02em;
	color: #fff;
}

.app-detail-intro {
	margin: 0 0 22px;
	font-size: 17px;
	color: var(--text-dim);
	max-width: 60ch;
}

.app-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
}

.app-actions a,
.app-actions span {
	display: inline-block;
	padding: 11px 22px;
	font-family: var(--mono);
	font-size: 10px;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	border: 1px solid var(--glass-edge);
	color: var(--text-dim);
	transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.app-actions a:first-child {
	background: var(--gold);
	border-color: var(--gold);
	color: var(--bg);
}

.app-actions a:first-child:hover {
	background: var(--gold-pale);
	border-color: var(--gold-pale);
	color: var(--bg);
}

.app-actions a.secondary:hover {
	border-color: rgba(217, 192, 127, 0.55);
	color: var(--gold-light);
}

.app-actions span {
	color: var(--text-faint);
	border-style: dashed;
}

.app-detail-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
	gap: 40px;
	padding-top: 32px;
}

.app-panel h3 {
	margin: 0 0 14px;
	font-family: var(--serif);
	font-weight: 300;
	font-size: 22px;
	color: #fff;
}

.app-panel h3 + p,
.app-panel p {
	margin: 0 0 14px;
	color: var(--text-muted);
	font-size: 15px;
	max-width: var(--readable);
}

.app-panel ul {
	margin: 0 0 22px;
	padding-left: 20px;
	color: var(--text-muted);
	font-size: 15px;
}

.app-panel li {
	margin-bottom: 8px;
}

.app-panel li::marker {
	color: var(--gold);
}

.privacy-list {
	list-style: none;
	padding: 0;
}

.privacy-list li {
	padding: 14px 0;
	border-top: 1px solid var(--hairline);
	margin: 0;
}

.privacy-list li:last-child {
	border-bottom: 1px solid var(--hairline);
}

.privacy-list strong {
	display: block;
	color: var(--gold-light);
	font-weight: 400;
	font-family: var(--mono);
	font-size: 10px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	margin-bottom: 6px;
}

.last-updated {
	font-family: var(--mono);
	font-size: 10px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--text-faint);
}

/* ================================================================
   PRIVACY DOCUMENTS
   (existing markup — no HTML changes needed, only this stylesheet)
   ================================================================ */

body.privacy-page {
	background: var(--bg);
}

.privacy-hero {
	position: relative;
	overflow: hidden;
	padding: clamp(48px, 6vw, 76px) 0 0;
}

.privacy-hero .content {
	display: flex;
	flex-direction: column;
	gap: 16px;
	max-width: var(--maxw);
}

.privacy-kicker {
	margin: 0;
	font-family: var(--mono);
	font-size: 11px;
	letter-spacing: 0.3em;
	text-transform: uppercase;
	color: var(--gold);
}

.privacy-hero h2 {
	margin: 0;
	font-family: var(--serif);
	font-weight: 200;
	font-size: clamp(34px, 5vw, 60px);
	line-height: 1.05;
	letter-spacing: -0.02em;
	color: #fff;
}

.privacy-hero p {
	margin: 0;
	color: var(--text-dim);
	max-width: var(--readable);
	font-size: 16px;
}

.privacy-meta {
	font-family: var(--mono);
	font-size: 10px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--text-muted) !important;
}

.privacy-meta strong {
	color: var(--text-dim);
	font-weight: 400;
}

/* Summary cards — the glass panel motif from the homepage */
.privacy-summary {
	max-width: var(--maxw);
	margin: 40px auto 0;
	padding: 0 var(--gutter);
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 16px;
}

.summary-card {
	background: var(--glass);
	backdrop-filter: blur(18px);
	-webkit-backdrop-filter: blur(18px);
	border: 1px solid var(--glass-edge);
	border-top-color: rgba(217, 192, 127, 0.4);
	padding: 26px 24px;
}

.summary-card h3 {
	margin: 0 0 10px;
	font-family: var(--serif);
	font-weight: 300;
	font-size: 19px;
	line-height: 1.3;
	color: #fff;
}

.summary-card p {
	margin: 0;
	font-size: 13.5px;
	line-height: 1.75;
	color: var(--text-muted);
}

/* Policy body */
.privacy-content {
	padding: clamp(48px, 6vw, 76px) 0 0;
}

.policy-container {
	max-width: 900px;
	margin: 0 auto;
	padding: 0 var(--gutter);
}

.policy-notice {
	border-left: 2px solid var(--gold);
	background: rgba(185, 156, 69, 0.07);
	padding: 18px 22px;
	margin-bottom: 40px;
}

.policy-notice p {
	margin: 0;
	font-size: 14px;
	color: var(--text-dim);
}

.policy-notice strong {
	color: var(--gold-light);
	font-weight: 400;
}

.policy-section {
	padding: 34px 0;
	border-top: 1px solid var(--hairline);
	scroll-margin-top: 24px;
}

.policy-section:first-of-type {
	border-top: 0;
	padding-top: 0;
}

.policy-section h3 {
	margin: 0 0 16px;
	font-family: var(--serif);
	font-weight: 300;
	font-size: clamp(22px, 2.4vw, 28px);
	line-height: 1.25;
	color: #fff;
	letter-spacing: -0.01em;
}

.policy-section p,
.policy-section li {
	color: var(--text-muted);
	font-size: 15px;
	line-height: 1.85;
}

.policy-section p {
	margin: 0 0 16px;
}

.policy-section ul,
.policy-section ol {
	margin: 0 0 16px;
	padding-left: 22px;
}

.policy-section li {
	margin-bottom: 10px;
}

.policy-section li::marker {
	color: var(--gold);
}

.policy-section strong {
	color: var(--text-dim);
	font-weight: 400;
}

.policy-section a {
	border-bottom: 1px solid rgba(217, 192, 127, 0.4);
}

/* Data tables — grid rows, scroll horizontally rather than squash */
.policy-table {
	border: 1px solid var(--hairline);
	margin: 0 0 22px;
	overflow-x: auto;
}

.policy-row {
	display: grid;
	grid-template-columns: 1.3fr 2fr 1fr 1fr;
	gap: 0;
	min-width: 620px;
}

.policy-row > span {
	padding: 13px 16px;
	font-size: 13px;
	line-height: 1.6;
	color: var(--text-muted);
	border-top: 1px solid var(--hairline);
}

.policy-row > span + span {
	border-left: 1px solid var(--hairline);
}

.policy-row.policy-head > span {
	border-top: 0;
	background: rgba(255, 255, 255, 0.035);
	font-family: var(--mono);
	font-size: 10px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--gold-light);
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
	:root {
		--gutter: 28px;
	}

	#header {
		flex-wrap: wrap;
		gap: 14px;
	}

	#header nav ul {
		gap: 18px;
	}

	.app-detail-header {
		grid-template-columns: 72px minmax(0, 1fr);
		gap: 20px;
	}

	.app-detail-icon img {
		width: 72px;
		height: 72px;
	}

	.app-detail-grid {
		grid-template-columns: 1fr;
		gap: 32px;
	}

	.apps-hero-dock {
		height: 112px;
	}

	.app-dock-item {
		width: 68px;
		height: 68px;
		margin: -34px 0 0 -34px;
	}

	.app-dock-item[data-position="-2"],
	.app-dock-item[data-position="2"],
	.app-dock-item[data-position="-1"],
	.app-dock-item[data-position="1"],
	.app-dock-item[data-position="0"] {
		transform: translateX(calc(var(--dock-offset, 0) * 78px)) scale(0.8);
	}

	.app-dock-item[data-position="0"] {
		transform: translateX(0) scale(1.1);
	}

	.section-head {
		flex-wrap: wrap;
		gap: 12px;
	}

	.section-head .rule {
		display: none;
	}
}

@media (max-width: 560px) {
	.apps-grid-list {
		grid-template-columns: 1fr;
	}

	.app-actions a,
	.app-actions span {
		flex: 1 1 auto;
		text-align: center;
	}
}

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

	.app-dock-item,
	.app-tile,
	.apps-hero-copy {
		transition: none;
	}
}
