/*
 * Barcodile website: home, support, privacy and the shared card page (/c).
 * Brand colors come from the app icon: orange background, green crocodile,
 * cream cards. Orange text and buttons use darker shades that keep WCAG AA
 * contrast (4.5:1) on the light background.
 */
:root {
	--brand-orange: #F26B0F;
	--brand-orange-top: #FD7D11;
	--brand-orange-bottom: #ED5E09;
	--brand-green: #0D6954;
	--brand-cream: #F7EAD8;

	--accent: #B04A08;
	--accent-strong: #C9500A;
	--accent-tint: rgba(242, 107, 15, 0.12);
	--on-accent: #FFFFFF;
	--background: #FBF8F4;
	--background-raised: #F4EEE6;
	--surface: #FFFFFF;
	--label: #1C1A17;
	--secondary-label: rgba(28, 26, 23, 0.66);
	--tertiary-label: rgba(28, 26, 23, 0.5);
	--separator: rgba(28, 26, 23, 0.1);
	--shadow: 0 1px 2px rgba(60, 30, 5, 0.06), 0 8px 24px rgba(60, 30, 5, 0.06);
	--glow: rgba(242, 107, 15, 0.22);
	--header-background: rgba(251, 248, 244, 0.82);

	--radius-card: 20px;
	--radius-large: 28px;
	--container: 1080px;
	--gutter: 20px;
	color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
	:root {
		--accent: #FF8A3D;
		--accent-tint: rgba(255, 138, 61, 0.14);
		--background: #12100E;
		--background-raised: #1A1714;
		--surface: #1E1B18;
		--label: #F7F1EA;
		--secondary-label: rgba(247, 241, 234, 0.68);
		--tertiary-label: rgba(247, 241, 234, 0.5);
		--separator: rgba(247, 241, 234, 0.12);
		--shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.28);
		--glow: rgba(242, 107, 15, 0.28);
		--header-background: rgba(18, 16, 14, 0.78);
	}
}

/*
 * Until share.js has put in the visitor's language, the page stays hidden so the
 * built-in English never flashes. A loader fades in only if that takes longer
 * than a moment, and without JavaScript the content still shows after 2.5 s.
 */
html.i18n-pending body > * {
	opacity: 0;
	animation: i18n-fallback 0.3s ease 2.5s forwards;
}

html.i18n-pending body::before {
	content: "";
	position: fixed;
	top: 50%;
	left: 50%;
	width: 64px;
	height: 64px;
	margin: -32px 0 0 -32px;
	background: url("/assets/brand/icon-128.png") center / contain no-repeat;
	opacity: 0;
	animation: i18n-loader 1.2s ease-in-out 0.25s infinite alternate, i18n-loader-end 0.01s linear 2.5s forwards;
}

body > * {
	transition: opacity 0.25s ease;
}

@keyframes i18n-fallback {
	to {
		opacity: 1;
	}
}

@keyframes i18n-loader-end {
	to {
		visibility: hidden;
	}
}

@keyframes i18n-loader {
	from {
		opacity: 0.35;
		transform: scale(0.94);
	}

	to {
		opacity: 1;
		transform: scale(1);
	}
}

/* Base */

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

/* Components set their own display; `hidden` must still win. */
[hidden] {
	display: none !important;
}

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

body {
	margin: 0;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	background: var(--background);
	color: var(--label);
	font: 17px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

main {
	flex: 1;
}

img,
svg {
	display: block;
	max-width: 100%;
}

a {
	color: var(--accent);
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

a:focus-visible,
button:focus-visible {
	outline: 3px solid var(--brand-orange);
	outline-offset: 3px;
	border-radius: 8px;
}

h1,
h2,
h3 {
	margin: 0;
	color: var(--label);
	letter-spacing: -0.02em;
	text-wrap: balance;
}

h1 {
	font-size: clamp(34px, 6vw, 56px);
	line-height: 1.05;
	font-weight: 800;
}

h2 {
	font-size: clamp(24px, 3.4vw, 34px);
	line-height: 1.15;
	font-weight: 700;
}

h3 {
	font-size: 17px;
	line-height: 1.3;
	font-weight: 650;
	letter-spacing: -0.01em;
}

p {
	margin: 0;
	text-wrap: pretty;
}

.container {
	width: 100%;
	max-width: var(--container);
	margin: 0 auto;
	padding-left: max(var(--gutter), env(safe-area-inset-left));
	padding-right: max(var(--gutter), env(safe-area-inset-right));
}

.container.narrow {
	max-width: 760px;
}

.eyebrow {
	margin: 0 0 10px;
	font-size: 13px;
	font-weight: 650;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--accent);
}

.lead {
	font-size: clamp(17px, 2vw, 20px);
	line-height: 1.5;
	color: var(--secondary-label);
}

/* Header */

.site-header {
	position: sticky;
	top: 0;
	z-index: 10;
	padding-top: env(safe-area-inset-top);
	background: var(--header-background);
	-webkit-backdrop-filter: saturate(180%) blur(16px);
	backdrop-filter: saturate(180%) blur(16px);
	border-bottom: 1px solid var(--separator);
}

.header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	min-height: 60px;
}

.brand {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	flex-shrink: 0;
	color: var(--label);
	font-size: 19px;
	font-weight: 750;
	letter-spacing: -0.02em;
	text-decoration: none;
}

.brand img {
	width: 32px;
	height: 32px;
	filter: drop-shadow(0 2px 4px rgba(150, 60, 0, 0.22));
}

.site-nav {
	display: flex;
	align-items: center;
	gap: 4px;
	min-width: 0;
}

.site-nav a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 12px;
	border-radius: 999px;
	color: var(--secondary-label);
	font-size: 15px;
	font-weight: 550;
	text-decoration: none;
	white-space: nowrap;
	transition: color 0.15s ease, background-color 0.15s ease;
}

.site-nav a:hover {
	color: var(--label);
	background: var(--accent-tint);
}

.site-nav a[aria-current="page"] {
	color: var(--label);
}

@media (max-width: 480px) {
	.site-nav a {
		padding: 0 8px;
		font-size: 14px;
	}
}

@media (max-width: 400px) {
	.site-header .brand span {
		display: none;
	}
}

/* Buttons */

.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 52px;
	padding: 0 26px;
	border: 0;
	border-radius: 999px;
	font: inherit;
	font-size: 17px;
	font-weight: 650;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.button:active {
	transform: scale(0.98);
}

.button:focus-visible {
	border-radius: 999px;
}

.primary {
	background: var(--accent-strong);
	color: var(--on-accent);
	box-shadow: 0 6px 18px rgba(201, 80, 10, 0.28);
}

.primary:hover {
	background: #B84A0A;
}

.secondary {
	background: var(--accent-tint);
	color: var(--accent);
}

.tertiary {
	min-height: 44px;
	background: transparent;
	color: var(--accent);
}

/* Home: hero */

.hero {
	position: relative;
	overflow: hidden;
	padding: clamp(40px, 8vw, 96px) 0 clamp(48px, 8vw, 104px);
}

.hero::before {
	content: "";
	position: absolute;
	inset: -30% -10% auto 40%;
	height: 120%;
	background: radial-gradient(closest-side, var(--glow), transparent);
	pointer-events: none;
}

.hero-inner {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
	align-items: center;
	gap: clamp(32px, 6vw, 72px);
}

.hero-copy .lead {
	max-width: 32em;
	margin-top: 20px;
}

.pill {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 20px;
	padding: 6px 14px 6px 10px;
	border-radius: 999px;
	background: var(--surface);
	box-shadow: var(--shadow);
	color: var(--secondary-label);
	font-size: 14px;
	font-weight: 600;
}

.pill svg {
	width: 16px;
	height: 16px;
	color: var(--brand-green);
}

.hero-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 16px;
	margin-top: 32px;
}

.soon {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	max-width: 100%;
	padding: 12px 18px;
	border-radius: 18px;
	text-align: left;
	background: var(--accent-tint);
	color: var(--label);
	font-size: 15px;
	font-weight: 600;
}

.soon::before {
	content: "";
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--brand-orange);
	box-shadow: 0 0 0 4px rgba(242, 107, 15, 0.2);
	flex-shrink: 0;
}

/* The app icon with two cards fanned out behind it, like the icon's own stack. */
.hero-art {
	position: relative;
	justify-self: center;
	width: min(100%, 380px);
	aspect-ratio: 1;
}

.hero-icon {
	position: absolute;
	inset: 12%;
	width: 76%;
	height: 76%;
	filter: drop-shadow(0 24px 40px rgba(150, 60, 0, 0.3)) drop-shadow(0 4px 10px rgba(150, 60, 0, 0.18));
	animation: float 7s ease-in-out infinite;
}

.art-card {
	position: absolute;
	width: 62%;
	aspect-ratio: 85.6 / 53.98;
	border-radius: 18px;
	box-shadow: 0 18px 36px rgba(40, 20, 0, 0.18);
}

.art-card-back {
	right: -2%;
	top: 6%;
	background: linear-gradient(135deg, #1F8A68, var(--brand-green));
	transform: rotate(14deg);
}

.art-card-mid {
	left: -4%;
	bottom: 4%;
	background: linear-gradient(135deg, #3A3633, #1C1A17);
	transform: rotate(-12deg);
}

.art-card::after {
	content: "";
	position: absolute;
	left: 12%;
	right: 40%;
	bottom: 16%;
	height: 14%;
	border-radius: 4px;
	background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.85) 0 3px, transparent 3px 6px, rgba(255, 255, 255, 0.85) 6px 7px, transparent 7px 11px);
	opacity: 0.7;
}

@keyframes float {
	0%,
	100% {
		transform: translateY(0) rotate(-2deg);
	}

	50% {
		transform: translateY(-10px) rotate(1deg);
	}
}

@media (max-width: 820px) {
	.hero-inner {
		grid-template-columns: 1fr;
		text-align: center;
	}

	.hero-art {
		order: -1;
		width: min(70%, 280px);
	}

	.hero-copy .lead {
		margin-left: auto;
		margin-right: auto;
	}

	.hero-actions {
		justify-content: center;
	}
}

/* Home: features */

.features {
	padding-bottom: clamp(48px, 8vw, 96px);
}

.section-title {
	max-width: 18em;
	margin-bottom: 32px;
}

.feature-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.feature {
	display: flex;
	gap: 18px;
	padding: 24px;
	border-radius: var(--radius-card);
	background: var(--surface);
	box-shadow: var(--shadow);
}

.feature-icon {
	display: grid;
	place-items: center;
	flex-shrink: 0;
	width: 48px;
	height: 48px;
	border-radius: 14px;
	background: linear-gradient(160deg, var(--brand-orange-top), var(--brand-orange-bottom));
	color: #FFFFFF;
	box-shadow: 0 6px 14px rgba(237, 94, 9, 0.28);
}

.feature-icon svg {
	width: 24px;
	height: 24px;
}

.feature:nth-child(even) .feature-icon {
	background: linear-gradient(160deg, #1F8A68, var(--brand-green));
	box-shadow: 0 6px 14px rgba(13, 105, 84, 0.28);
}

.feature p {
	color: var(--secondary-label);
	font-size: 16px;
}

.feature strong {
	display: block;
	margin-bottom: 4px;
	color: var(--label);
	font-size: 17px;
	font-weight: 650;
}

@media (max-width: 720px) {
	.feature-grid {
		grid-template-columns: 1fr;
	}

	.feature {
		padding: 20px;
	}
}

/* Home: privacy band */

.privacy-band {
	padding-bottom: clamp(56px, 9vw, 112px);
}

.band {
	position: relative;
	overflow: hidden;
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	align-items: center;
	gap: 28px;
	padding: clamp(28px, 5vw, 48px);
	border-radius: var(--radius-large);
	background: linear-gradient(140deg, #13785F, var(--brand-green) 55%, #0A5544);
	color: #FFFFFF;
}

.band::after {
	content: "";
	position: absolute;
	right: -60px;
	top: -60px;
	width: 240px;
	height: 240px;
	border-radius: 50%;
	background: radial-gradient(closest-side, rgba(247, 234, 216, 0.18), transparent);
}

.band-icon {
	display: grid;
	place-items: center;
	width: 72px;
	height: 72px;
	border-radius: 22px;
	background: rgba(247, 234, 216, 0.14);
	color: var(--brand-cream);
}

.band-icon svg {
	width: 36px;
	height: 36px;
}

.band h2 {
	color: #FFFFFF;
}

.band p {
	max-width: 40em;
	margin-top: 10px;
	color: rgba(255, 255, 255, 0.84);
}

.link-arrow {
	display: inline-block;
	margin-top: 8px;
	padding: 10px 0;
	color: var(--brand-cream);
	font-weight: 650;
	text-decoration: none;
}

.link-arrow::after {
	content: "→";
	display: inline-block;
	margin-left: 6px;
	transition: transform 0.15s ease;
}

.link-arrow:hover::after {
	transform: translateX(3px);
}

@media (max-width: 600px) {
	.band {
		grid-template-columns: 1fr;
		gap: 20px;
	}

	.band-icon {
		width: 56px;
		height: 56px;
		border-radius: 18px;
	}
}

/* Support and privacy pages */

.page-hero {
	padding: clamp(40px, 7vw, 80px) 0 clamp(24px, 4vw, 40px);
	background: linear-gradient(180deg, var(--background-raised), var(--background));
	border-bottom: 1px solid var(--separator);
}

.page-hero .lead {
	margin-top: 16px;
}

.updated {
	margin-top: 12px;
	color: var(--tertiary-label);
	font-size: 14px;
}

.doc {
	padding-top: 32px;
	padding-bottom: clamp(48px, 8vw, 96px);
}

.doc-section {
	padding: 24px 0;
	border-bottom: 1px solid var(--separator);
}

.doc-section:first-child {
	padding-top: 0;
}

.doc-section h2 {
	margin-bottom: 8px;
	font-size: 20px;
	line-height: 1.3;
	font-weight: 650;
	letter-spacing: -0.01em;
}

.doc-section p {
	color: var(--secondary-label);
}

.doc-section em {
	color: var(--label);
	font-style: normal;
	font-weight: 600;
}

.doc-section a {
	overflow-wrap: anywhere;
}

.contact {
	margin-top: 40px;
	padding: clamp(28px, 5vw, 40px);
	border-radius: var(--radius-large);
	background: var(--surface);
	box-shadow: var(--shadow);
	text-align: center;
}

.contact h2 {
	font-size: 24px;
}

.contact p {
	max-width: 30em;
	margin: 10px auto 24px;
	color: var(--secondary-label);
}

.contact .button {
	max-width: 100%;
	overflow-wrap: anywhere;
}

/* Footer */

.site-footer {
	padding: 32px 0 max(32px, env(safe-area-inset-bottom));
	border-top: 1px solid var(--separator);
	background: var(--background-raised);
	font-size: 15px;
}

.footer-inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px 32px;
}

.footer-inner .brand {
	font-size: 17px;
}

.footer-inner .brand img {
	width: 28px;
	height: 28px;
}

.footer-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 20px;
}

.footer-nav a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	color: var(--secondary-label);
	text-decoration: none;
}

.footer-nav a:hover {
	color: var(--label);
}

.copyright {
	width: 100%;
	color: var(--tertiary-label);
	font-size: 13px;
}

@media (max-width: 600px) {
	.footer-inner {
		flex-direction: column;
		align-items: flex-start;
		gap: 8px;
	}
}

/* Shared card page (/c) */

.share-page {
	max-width: 460px;
	margin: 0 auto;
	padding: 8px var(--gutter) 48px;
}

/* The card floats in a soft light, like the opened card in the app. */
.stage {
	position: relative;
	padding: 28px 8px 36px;
}

.stage::before {
	content: "";
	position: absolute;
	inset: -10% -20% 10%;
	background: radial-gradient(closest-side, var(--glow), transparent);
	z-index: -1;
}

.card {
	position: relative;
	aspect-ratio: 85.6 / 53.98;
	border-radius: 18px;
	padding: 18px 18px 16px;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	color: #FFFFFF;
	background: linear-gradient(135deg, #3A3633, #1C1A17);
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.28),
		0 18px 40px rgba(0, 0, 0, 0.22),
		0 2px 6px rgba(0, 0, 0, 0.12);
	overflow: hidden;
	transition: opacity 0.4s ease;
}

.card::after {
	/* Satin sheen across the face. */
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(115deg, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, 0.16) 48%, rgba(255, 255, 255, 0) 62%);
	pointer-events: none;
}

.card.dark-text {
	color: #14141A;
}

.card-header {
	display: flex;
	align-items: center;
	gap: 12px;
}

.monogram {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	border-radius: 10px;
	background: rgba(255, 255, 255, 0.22);
	font: 700 15px/1 ui-rounded, -apple-system, sans-serif;
}

.card.dark-text .monogram {
	background: rgba(20, 20, 26, 0.1);
}

.card-name {
	font-weight: 600;
	font-size: 17px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.card-footer {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.field-label {
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	opacity: 0.72;
}

.field-value {
	font-size: 20px;
	font-weight: 600;
	letter-spacing: 0.08em;
}

.content {
	text-align: center;
}

.content h1 {
	margin-bottom: 10px;
	font-size: 28px;
	line-height: 1.15;
	font-weight: 750;
}

.content .eyebrow {
	margin-bottom: 6px;
}

.content .lead {
	max-width: 34ch;
	margin: 0 auto 24px;
	font-size: 17px;
}

.actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 24px;
}

.actions .soon {
	align-self: center;
}

.steps {
	margin: 0 0 12px;
	padding: 16px 16px 16px 36px;
	text-align: left;
	background: var(--surface);
	border-radius: 16px;
	box-shadow: var(--shadow);
	font-size: 15px;
	color: var(--secondary-label);
}

.steps li + li {
	margin-top: 8px;
}

.steps strong,
.steps em {
	color: var(--label);
	font-style: normal;
	font-weight: 600;
}

.content > .tertiary {
	margin: 0 auto;
}

.copied {
	margin-top: 4px;
	font-size: 13px;
	color: var(--secondary-label);
}

.privacy {
	margin: 28px auto 0;
	max-width: 36ch;
	font-size: 13px;
	color: var(--secondary-label);
}

/* Until the link is read, only the card silhouette shows. */
body:not(.is-ready):not(.is-error) .card {
	opacity: 0.4;
}

body.is-error .card {
	opacity: 0.25;
}

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

	html.i18n-pending body::before {
		animation: i18n-fallback 0.2s ease 0.25s forwards, i18n-loader-end 0.01s linear 2.5s forwards;
	}

	.hero-icon {
		animation: none;
	}

	.card,
	.button,
	.link-arrow::after {
		transition: none;
	}
}
