/* Tangelligence — mobile-first, progressively enhanced stylesheet */

:root {
	color-scheme: dark;
	--bg: #000;
	--surface: #141414;
	--surface-2: #1d1d1d;
	--line: #2e2e2e;
	--text: #f2f2f2;
	--muted: #a8a8a8;
	--grey: #999;
	--accent: #f4a6c6;
	--accent-ink: #000;
	--new: #ffcf5c;
	--radius: 12px;
	--gutter: 16px;
	--max: 68rem;
	--font: system-ui, -apple-system, "Segoe UI", Roboto, Verdana, Arial, sans-serif;
	--font-display: "Arial Black", "Helvetica Neue", Arial, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
	margin: 0;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	font-family: var(--font);
	font-size: 1.0625rem;
	line-height: 1.65;
	color: var(--text);
	background-color: var(--bg);
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-underline-offset: 0.2em; }
a:hover { color: var(--text); }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.6em; }
h1 { font-family: var(--font-display); font-size: clamp(2rem, 6vw, 3.5rem); letter-spacing: -0.01em; }
h2 { font-family: var(--font-display); font-size: clamp(1.4rem, 3.5vw, 2rem); color: var(--accent); }
h3 { font-size: 1.15rem; }
p, ul, ol { margin: 0 0 1em; }

.skip-link {
	position: absolute;
	left: var(--gutter);
	top: -100px;
	padding: 0.5em 1em;
	background: var(--accent);
	color: var(--accent-ink);
	font-weight: 700;
	z-index: 100;
}
.skip-link:focus { top: var(--gutter); }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* Header & navigation */

.site-header {
	position: sticky;
	top: 0;
	z-index: 10;
	background: rgba(0, 0, 0, 0.92);
	border-bottom: 1px solid var(--line);
}
@supports (backdrop-filter: blur(8px)) {
	.site-header { background: rgba(0, 0, 0, 0.75); backdrop-filter: blur(8px); }
}
.site-header .wrap {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem 1.5rem;
	padding-top: 0.75rem;
	padding-bottom: 0.75rem;
}

.brand {
	font-family: var(--font-display);
	font-size: 1.1rem;
	line-height: 1.05;
	color: var(--text);
	text-decoration: none;
	display: inline-block;
}
.brand span { display: block; }
.brand .hl { display: inline; color: var(--grey); }
.brand span + span { padding-left: 1.1em; }

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

/* Phones: header scrolls away and the menu becomes one swipeable row */
@media (max-width: 39.99rem) {
	.site-header { position: static; }
	.navbar { width: 100%; }
	.navbar ul { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter); }
	.navbar ul::-webkit-scrollbar { display: none; }
	.navbar a { white-space: nowrap; }
}
.navbar a {
	display: block;
	padding: 0.4rem 0.75rem;
	border-radius: 999px;
	color: var(--text);
	text-decoration: none;
	font-weight: 600;
	font-size: 0.95rem;
}
.navbar a:hover { background: var(--surface-2); }
.navbar a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); }

/* Main content */

main { flex: 1; padding: 2.5rem 0 4rem; }

.hero { padding: 2rem 0 3rem; border-bottom: 1px solid var(--line); margin-bottom: 3rem; }
.hero .eyebrow {
	text-transform: uppercase;
	letter-spacing: 0.15em;
	font-size: 0.8rem;
	font-weight: 700;
	color: var(--accent);
	margin-bottom: 0.75rem;
}
.hero .lead { font-size: clamp(1.1rem, 2.5vw, 1.35rem); color: var(--muted); max-width: 42rem; }
.hero .lead strong { color: var(--text); }

.page-title { margin-bottom: 2rem; }
.page-title p { color: var(--muted); max-width: 42rem; font-size: 1.15rem; }

section { margin-bottom: 3.5rem; }

.prose { max-width: 44rem; }

.grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 40rem) { .grid-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 56rem) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 40rem) and (max-width: 55.99rem) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }

.card {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 1.5rem;
}
.card > :last-child { margin-bottom: 0; }
.card h3 { color: var(--text); }
.card .num {
	display: inline-block;
	font-family: var(--font-display);
	color: var(--accent);
	font-size: 0.85rem;
	letter-spacing: 0.1em;
	margin-bottom: 0.4rem;
}
.card.contrast-bad { border-left: 4px solid var(--grey); }
.card.contrast-good { border-left: 4px solid var(--accent); }

ul.ticks { list-style: none; padding: 0; }
ul.ticks li { position: relative; padding-left: 1.5em; margin-bottom: 0.4em; }
ul.ticks li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.65em;
	width: 0.6em;
	height: 0.6em;
	border-radius: 50%;
	background: var(--accent);
}

blockquote {
	margin: 2rem 0;
	padding: 0 0 0 1.25rem;
	border-left: 4px solid var(--accent);
	font-size: 1.2rem;
	font-style: italic;
	max-width: 40rem;
}
blockquote footer { font-size: 0.9rem; font-style: normal; color: var(--muted); margin-top: 0.5rem; }

.cs { display: flex; flex-wrap: wrap; gap: 0.75rem; padding: 0; list-style: none; }
.cs li {
	flex: 1 1 10rem;
	text-align: center;
	padding: 1.25rem 1rem;
	border: 1px solid var(--accent);
	border-radius: var(--radius);
	font-family: var(--font-display);
	font-size: 1.15rem;
}

.btn {
	display: inline-block;
	padding: 0.7rem 1.3rem;
	border-radius: 999px;
	background: var(--accent);
	color: var(--accent-ink);
	font-weight: 700;
	text-decoration: none;
	border: 2px solid var(--accent);
}
.btn:hover { background: transparent; color: var(--accent); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }

.service { border-top: 1px solid var(--line); padding-top: 2rem; }

/* Team */

.person { display: grid; gap: 1.5rem; align-items: start; }
@media (min-width: 40rem) { .person { grid-template-columns: 12rem 1fr; } }
.person img {
	width: 12rem;
	aspect-ratio: 1;
	object-fit: cover;
	object-position: center 30%;
	border-radius: 50%;
	border: 3px solid var(--accent);
}

/* Digital products */

.product-grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 1rem;
	grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 40rem) { .product-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 56rem) { .product-grid { grid-template-columns: repeat(4, 1fr); } }
.product-tile {
	height: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1rem;
	padding: 1.75rem 1rem;
	text-align: center;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	color: var(--text);
	text-decoration: none;
	transition: border-color 0.15s, transform 0.15s;
}
.product-tile:hover { color: var(--text); border-color: var(--accent); transform: translateY(-2px); }
.product-icon { width: 4rem; height: 4rem; flex: none; color: var(--accent); }
.product-name { font-weight: 700; line-height: 1.3; }
.product-icon .icon-fill { fill: var(--surface); }

.back-link { margin-bottom: 1.5rem; font-size: 0.95rem; }
.product-head { display: flex; align-items: center; gap: 1.25rem; margin-bottom: 1.5rem; }
.product-head .product-icon { width: 4.5rem; height: 4.5rem; padding: 0.75rem; box-sizing: content-box; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.product-head h1 { margin: 0; font-size: clamp(1.7rem, 5vw, 2.6rem); }
.product .eyebrow {
	margin: 0 0 0.3rem;
	text-transform: uppercase;
	letter-spacing: 0.15em;
	font-size: 0.8rem;
	font-weight: 700;
	color: var(--accent);
}
.product .lead { font-size: clamp(1.1rem, 2.5vw, 1.3rem); color: var(--muted); }
.product h2 { font-size: 1.3rem; margin-top: 2rem; }

/* "New – Coming Soon:" label in front of product titles */
.soon {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	margin-bottom: 0.35rem;
	font-family: var(--font);
	font-size: 0.9rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	color: var(--new);
}
.new-badge { width: 2.1rem; height: 2.1rem; flex: none; }
.new-badge path { fill: var(--new); }
.new-badge text { fill: var(--accent-ink); font: 800 9.5px var(--font); letter-spacing: 0.02em; }
.product-name .soon { margin-bottom: 0.5rem; }
.product-head h1 .h1-soon { display: block; }
.product-head h1 .soon { justify-content: flex-start; font-size: 1rem; margin-bottom: 0.4rem; }

ul.prices { list-style: none; margin: 0 0 1em; padding: 0; border-top: 1px solid var(--line); }
ul.prices li {
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: center;
	gap: 0.6rem 1.25rem;
	padding: 1rem 0;
	border-bottom: 1px solid var(--line);
}
ul.prices .price { font-family: var(--font-display); font-size: 1.3rem; color: var(--text); text-align: right; }
ul.prices .btn { grid-column: 1 / -1; justify-self: start; }
@media (min-width: 48rem) {
	ul.prices li { grid-template-columns: 1fr auto auto; }
	ul.prices .btn { grid-column: auto; }
}
button.btn { font: inherit; font-weight: 700; cursor: pointer; }
.btn:disabled, .btn:disabled:hover { background: var(--surface-2); border-color: var(--line); color: var(--muted); cursor: not-allowed; }

/* Accounts, forms and administration */

.form-card { max-width: 34rem; }
.form-card .intro { color: var(--muted); font-size: 1.1rem; }
.form { margin: 0; }
.field { margin-bottom: 1.1rem; }
.field label, .checks legend { display: block; font-weight: 700; margin-bottom: 0.35rem; }
input:not([type="checkbox"]):not([type="hidden"]), select, textarea {
	width: 100%;
	font: inherit;
	color: var(--text);
	background: var(--bg);
	border: 1px solid var(--line);
	border-radius: 8px;
	padding: 0.6rem 0.75rem;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { min-height: 12rem; resize: vertical; line-height: 1.5; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 5rem; }
.password-toggle {
	position: absolute;
	top: 50%;
	right: 0.4rem;
	transform: translateY(-50%);
	font: inherit;
	font-size: 0.85rem;
	font-weight: 700;
	color: var(--accent);
	background: transparent;
	border: 1px solid var(--line);
	border-radius: 999px;
	padding: 0.2rem 0.75rem;
	cursor: pointer;
}
.password-toggle:hover { border-color: var(--accent); }
input[type="checkbox"] { width: 1.15rem; height: 1.15rem; margin: 0.25rem 0 0; accent-color: var(--accent); flex: none; }
.hint { color: var(--muted); font-size: 0.9rem; margin: 0.35rem 0 0; }
p.hint { margin-bottom: 1rem; }
.checks { border: 0; padding: 0; margin: 0 0 1.25rem; }
.checks legend { padding: 0; }
.check { display: flex; gap: 0.6rem; align-items: flex-start; margin-bottom: 0.6rem; cursor: pointer; }
.check .hint { margin: 0; }
details.hint summary { cursor: pointer; color: var(--accent); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.form-links { margin-top: 1.5rem; color: var(--muted); }
.inline-form { display: inline; margin: 0; }

.flash { border-radius: var(--radius); padding: 0.8rem 1rem; margin: 0 0 1.5rem; border: 1px solid; }
.flash.success { border-color: var(--accent); background: rgba(244, 166, 198, 0.1); }
.flash.error { border-color: #ff7b7b; background: rgba(255, 123, 123, 0.12); }
.flash ul { margin: 0; padding-left: 1.2rem; }

.btn.small { padding: 0.35rem 0.9rem; font-size: 0.9rem; }
.btn.danger { background: transparent; color: #ff9c9c; border-color: #ff7b7b; }
.btn.danger:hover { background: #ff7b7b; color: #000; }
.card.danger { border-color: #5c2a2a; margin-top: 2rem; }
.card h2 { font-size: 1.3rem; }

.account-grid { display: grid; gap: 1rem; align-items: start; }
@media (min-width: 56rem) { .account-grid { grid-template-columns: 1fr 1fr; } }
.stack { display: grid; gap: 1rem; }
.stack .card.danger { margin-top: 0; }

.subnav { margin-bottom: 2rem; border-bottom: 1px solid var(--line); padding-bottom: 0.75rem; }
.subnav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem; }
.subnav a { display: block; padding: 0.3rem 0.8rem; border-radius: 999px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.subnav a:hover { color: var(--text); background: var(--surface-2); }
.subnav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }

.table-wrap { overflow-x: auto; margin-bottom: 1.5rem; }
.table { width: 100%; border-collapse: collapse; font-size: 0.95rem; margin-bottom: 1.5rem; }
.table-wrap .table { margin-bottom: 0; }
.table th, .table td { text-align: left; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { color: var(--muted); font-weight: 600; white-space: nowrap; }
.table .num { text-align: right; }
.badge { display: inline-block; font-size: 0.78rem; font-weight: 700; padding: 0.1rem 0.55rem; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.badge.active, .badge.sent { color: var(--accent); border-color: var(--accent); }
.badge.admin, .badge.sending { color: var(--new); border-color: var(--new); }
.badge.disabled { color: #ff9c9c; border-color: #ff7b7b; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.5rem; }
.filter-bar input { max-width: 18rem; }
.filter-bar select { width: auto; }
.stats .stat { color: var(--text); text-decoration: none; }
.stats .stat:hover { border-color: var(--accent); color: var(--text); }
.stats .num { display: block; font-size: 2rem; margin: 0; }
.newsletter-preview { background: #fff; color: #111; border-radius: var(--radius); padding: 1.5rem; max-width: 40rem; margin-bottom: 1.5rem; }
.newsletter-preview h2, .newsletter-preview h3 { color: #111; font-family: var(--font); }
.newsletter-preview a { color: #c2185b; }
progress { width: 100%; max-width: 30rem; height: 1rem; accent-color: var(--accent); margin-bottom: 1.5rem; }
.delete-draft { display: block; margin-top: 2rem; }

/* "Notify me" box on the product pages */
.notify { margin-top: 2.5rem; padding: 1.25rem 1.5rem; border: 1px dashed var(--line); border-radius: var(--radius); }
.notify p { margin-bottom: 0.75rem; }
.notify > :last-child { margin-bottom: 0; }

/* Contact & legal */

address { font-style: normal; }
dl.facts { display: grid; grid-template-columns: 1fr; gap: 0.25rem 1.5rem; margin: 0 0 1.5rem; }
dl.facts dt { color: var(--muted); font-size: 0.9rem; }
dl.facts dd { margin: 0 0 0.75rem; }
@media (min-width: 40rem) {
	dl.facts { grid-template-columns: 14rem 1fr; }
	dl.facts dd { margin: 0; }
}

.legal h2 { font-size: 1.3rem; margin-top: 2.5rem; }
.legal h3 { margin-top: 1.5rem; }

/* Placeholder for details the owner still has to supply — remove once filled in */
.todo { background: #5a4a00; color: #ffe680; padding: 0 0.3em; border-radius: 3px; }

/* Footer */

.site-footer { border-top: 1px solid var(--line); padding: 2rem 0; font-size: 0.9rem; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }
.site-footer p { margin: 0; }

/* Install button is revealed by JavaScript only when the browser offers installation */
.install-btn[hidden] { display: none; }
.install-btn {
	font: inherit;
	cursor: pointer;
	background: none;
	color: var(--accent);
	border: 1px solid var(--accent);
	border-radius: 999px;
	padding: 0.25rem 0.9rem;
}

.offline-banner {
	position: fixed;
	bottom: var(--gutter);
	left: 50%;
	transform: translateX(-50%);
	background: var(--surface-2);
	border: 1px solid var(--accent);
	border-radius: 999px;
	padding: 0.4rem 1rem;
	font-size: 0.9rem;
	z-index: 20;
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	* { transition: none !important; animation: none !important; }
}

@media print {
	body { background: #fff; color: #000; }
	.site-header, .site-footer, .skip-link, .actions, .subnav { display: none; }
	a { color: #000; }
	h2 { color: #000; }
	.card { border-color: #ccc; background: none; }
}
