/* ===========================================================================
   Cocoa Packet Analyzer — landing page
   Stand-alone: no Bootstrap. Dark bands (hero, closing call) frame light
   content bands; the light bands follow the system appearance.
   legal.html and privacy_policy_mas.html use it too.
   =========================================================================== */

:root {
	--bar-height: 77px; /* the sticky nav bar; anchors and snapping stop below it */
	--accent: #0071e3;
	--accent-hover: #0062cc;
	--link: #0062cc;
	--link-hover: #004a99;

	/* Dark bands — the same in both appearances */
	--night: #0b0e13;
	--night-raised: #151a22;
	--night-line: #2e3a4a;
	--night-text: #f5f7fa;
	--night-muted: #a9b4c2;
	--night-faint: #8fa0b3;

	/* Light bands */
	--ground: #ffffff;
	--ground-alt: #f5f6f8;
	--card: #ffffff;
	--line: #e1e5ea;
	--line-strong: #d5dbe2;
	--text: #12161c;
	--text-muted: #515b67;
	--text-body: #3b4450;
	--check: #1a7f37;

	--radius: 12px;
	--gutter: clamp(16px, 4vw, 40px);
	--measure: 1180px;
	--mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--link: #4ea1ff;
		--link-hover: #7ab8ff;
		--ground: #10141a;
		--ground-alt: #161b22;
		--card: #1b212a;
		--line: #2a323d;
		--line-strong: #36404d;
		--text: #eef1f5;
		--text-muted: #a3adb9;
		--text-body: #c3cbd5;
		--check: #4ac26b;
	}
}
:root[data-theme="dark"] {
	--link: #4ea1ff;
	--link-hover: #7ab8ff;
	--ground: #10141a;
	--ground-alt: #161b22;
	--card: #1b212a;
	--line: #2a323d;
	--line-strong: #36404d;
	--text: #eef1f5;
	--text-muted: #a3adb9;
	--text-body: #c3cbd5;
	--check: #4ac26b;
}

/* ---------- Base --------------------------------------------------------- */

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

/* Section snapping, as on the previous site, but proximity rather than
   mandatory: the scroll settles on a band's top only when it stops near one.
   Mandatory pulled the page to a band edge wherever it stopped, so with FAQ
   answers open the questions below them could not be reached. Off on phones
   (below), where it fights momentum scrolling. */
html { scroll-behavior: smooth; scroll-snap-type: y proximity; scroll-padding-top: var(--bar-height); }
#top, main > section, #download { scroll-snap-align: start; }
/* The page's end is a snap point too. With scroll-padding-top the last start
   point sits a bar's height above it, and proximity snapping kept pulling the
   footer back out of view. */
.site-footer { scroll-snap-align: end; }
/* The hero, tasks and loops bands run two to three windows tall, and with
   snap points only at their tops a scroll that stopped inside one never
   settled anywhere. Each task and loop is shorter than a window, so it is a
   snap point of its own, centred below the bar; a loop that snaps in is
   fully in view and starts. */
.hero-shot, .task, .loops figure { scroll-snap-align: center; }
@media (max-width: 767px) {
	html { scroll-snap-type: none; }
}

body {
	margin: 0;
	font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
	font-size: 16px;
	line-height: 1.5;
	color: var(--text);
	background: var(--ground);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	overflow-x: hidden;
}

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

a { color: var(--link); }
a:hover { color: var(--link-hover); }

code {
	font-family: var(--mono);
	font-size: 0.92em;
}

h1, h2, h3 { margin: 0; }
p { margin: 0; }

.wrap {
	max-width: var(--measure);
	margin: 0 auto;
	padding-left: var(--gutter);
	padding-right: var(--gutter);
}

.skip-link {
	position: absolute;
	left: 8px;
	top: -48px;
	z-index: 10;
	background: var(--accent);
	color: #fff;
	padding: 10px 14px;
	border-radius: 8px;
	text-decoration: none;
}
.skip-link:focus { top: 8px; color: #fff; }

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

/* ---------- Buttons ------------------------------------------------------ */

.btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-height: 44px;
	padding: 12px 24px;
	border-radius: 10px;
	font-size: 17px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	border: 1px solid transparent;
}
.btn svg { flex: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-ghost { color: var(--night-text); border-color: var(--night-line); }
.btn-ghost:hover { color: #fff; border-color: var(--night-muted); }
.btn-dark { background: var(--text); color: var(--ground); font-size: 16px; }
.btn-dark:hover { color: var(--ground); opacity: 0.88; }
.btn-small { font-size: 15px; padding: 9px 16px; }

.brew {
	font-family: var(--mono);
	background: var(--night-raised);
	border: 1px solid var(--night-line);
	padding: 3px 8px;
	border-radius: 6px;
	color: #dce3eb;
	white-space: nowrap;
}

/* ---------- Icon tiles --------------------------------------------------- */

/* The site's white glyphs on a rounded tile, one system colour per theme, as
   on the previous site: red capture, blue analyze, green decrypt, purple the
   rest; orange is the Plugin SDK. */
.tile {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 10px;
	vertical-align: middle;
}
.tile img { width: 22px; height: 22px; }
.tile-small { width: 28px; height: 28px; border-radius: 7px; }
.tile-small img { width: 16px; height: 16px; }
.tile-red { background: #e5443a; }
.tile-blue { background: #0a6fdb; }
.tile-green { background: #23944a; }
.tile-purple { background: #9a4fd0; }
.tile-orange { background: #d9730d; }

.eyebrow { display: flex; align-items: center; gap: 10px; }
.feature-groups h3 { display: flex; align-items: center; gap: 12px; }

/* Hero chips: notarized, languages, appearance. */
.chips {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
}
.chips li {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font-size: 13px;
	color: var(--night-muted);
	padding: 5px 12px;
	border: 1px solid var(--night-line);
	border-radius: 999px;
	background: var(--night-raised);
}
.chips img { width: 16px; height: 16px; }

/* ---------- Dark bands: nav, hero, closing call -------------------------- */

.night { background: var(--night); color: var(--night-text); }
.night a:not(.btn) { color: var(--night-muted); }
.night a:not(.btn):hover { color: #fff; }

.site-nav {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding-top: 16px;
	padding-bottom: 16px;
}
/* The nav bar stays at the top of every page. Over the hero it matches the
   band; over the light bands the content blurs through it. */
.site-bar {
	position: sticky;
	top: 0;
	z-index: 5;
	background: rgba(11, 14, 19, 0.88);
	-webkit-backdrop-filter: saturate(180%) blur(14px);
	backdrop-filter: saturate(180%) blur(14px);
	border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.night .brand {
	display: flex;
	align-items: center;
	gap: 10px;
	color: var(--night-text);
	text-decoration: none;
	font-weight: 600;
	font-size: 17px;
}
.site-nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 24px;
	font-size: 15px;
}
.night .site-nav ul a:not(.btn) { color: #c9d2dd; text-decoration: none; }
.night .site-nav ul a:not(.btn):hover { color: #fff; }
@media (max-width: 760px) {
	/* On a phone the bar keeps the brand, the language switch and Download; the
	   sections are a scroll away. */
	.site-nav li:not(.nav-download):not(.nav-lang) { display: none; }
}

.hero {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 24px;
	padding-top: clamp(40px, 8vw, 96px);
	padding-bottom: clamp(32px, 5vw, 64px);
}
.eyebrow-hero {
	font-size: 14px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--night-faint);
	font-weight: 600;
}
.hero h1 {
	font-size: clamp(38px, 6vw, 68px);
	line-height: 1.05;
	letter-spacing: -0.02em;
	font-weight: 700;
	max-width: 920px;
}
.hero-lede {
	font-size: clamp(17px, 2vw, 21px);
	line-height: 1.5;
	color: var(--night-muted);
	max-width: 720px;
}
.hero-actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 12px;
	margin-top: 8px;
}
.hero-note { font-size: 14px; color: var(--night-faint); }
.hero-meta { font-size: 13px; color: var(--night-faint); }

.hero-shot {
	margin: 32px 0 0;
	width: 100%;
	max-width: 1080px;
}
/* The screenshots carry their own window shadow on a transparent margin, so
   they get no frame of their own. */
.hero-shot img { width: 100%; }
/* The picture's transparent shadow margin already spaces the caption. */
.hero-shot figcaption {
	margin-top: 4px;
	text-align: center;
	font-size: 14px;
	color: var(--night-muted);
}

/* ---------- Light bands -------------------------------------------------- */

.band { background: var(--ground); }
.band-alt { background: var(--ground-alt); }
.band > .wrap, .band-alt > .wrap {
	padding-top: clamp(56px, 7vw, 96px);
	padding-bottom: clamp(56px, 7vw, 96px);
	display: flex;
	flex-direction: column;
	gap: 32px;
}

.section-head { display: flex; flex-direction: column; gap: 12px; max-width: 760px; }
.section-head h2 {
	font-size: clamp(30px, 4vw, 44px);
	line-height: 1.1;
	letter-spacing: -0.015em;
}
.section-head p { font-size: 19px; line-height: 1.5; color: var(--text-muted); }

/* Free. All of it. */
.free-grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
	gap: 16px;
}
.free-grid li {
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 20px;
	display: flex;
	gap: 14px;
	align-items: flex-start;
}
.free-grid svg { flex: none; margin-top: 1px; color: var(--check); }
.free-grid strong { display: block; font-size: 16px; margin-bottom: 4px; }
.free-grid span { font-size: 14px; line-height: 1.45; color: var(--text-muted); }

/* Tasks */
#tasks > .wrap { gap: clamp(48px, 6vw, 80px); }
.task {
	display: flex;
	flex-wrap: wrap;
	gap: clamp(24px, 4vw, 56px);
	align-items: center;
}
.task:nth-of-type(even) { flex-direction: row-reverse; }
.task-text {
	flex: 1 1 320px;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 14px;
}
.eyebrow {
	font-size: 13px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--link);
	font-weight: 700;
}
.task h3 {
	font-size: clamp(24px, 3vw, 32px);
	line-height: 1.15;
	letter-spacing: -0.01em;
}
.task-text p:not(.eyebrow) { font-size: 17px; line-height: 1.55; color: var(--text-muted); }
.task figure { flex: 1.3 1 420px; min-width: 0; margin: 0; }
.task figure img { width: 100%; }

/* Screenshots enlarge in a lightbox */
img.zoomable { cursor: zoom-in; }
img.zoomable:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: var(--radius); }
.lightbox {
	padding: 0;
	border: 0;
	background: transparent;
	max-width: 96vw;
	max-height: 94vh;
	overflow: visible;
	cursor: zoom-out;
	outline: none;
}
.lightbox::backdrop { background: rgba(5, 7, 10, 0.82); backdrop-filter: blur(6px); }
.lightbox img {
	display: block;
	width: auto;
	height: auto;
	max-width: 96vw;
	max-height: 94vh;
}

/* See it move — the three loops */
/* One loop per row, caption beside it, alternating sides like the tasks —
   three side by side made each ~350 px wide and its text unreadable. */
.loops { display: flex; flex-direction: column; gap: clamp(40px, 5vw, 64px); }
.loops figure {
	margin: 0;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: clamp(20px, 3vw, 40px);
}
.loops figure:nth-of-type(even) { flex-direction: row-reverse; }
.loops video {
	flex: 2.4 1 480px;
	min-width: 0;
	width: 100%;
	max-width: 660px; /* a little smaller than the row would make it; the caption takes the rest */
	height: auto;
	display: block;
	border-radius: var(--radius);
	border: 1px solid var(--night-line);
	background: var(--night-raised);
}
.loops figcaption { flex: 1 1 240px; display: flex; flex-direction: column; gap: 10px; }
.loops figcaption strong { display: block; font-size: clamp(20px, 2.2vw, 26px); line-height: 1.2; }
.loops figcaption span { font-size: 17px; line-height: 1.55; color: var(--night-muted); }

/* All features */
.feature-groups {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 28px 24px;
}
.feature-groups section {
	border-top: 2px solid var(--text);
	padding-top: 14px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.feature-groups h3 { font-size: 17px; }
.feature-groups ul {
	margin: 0;
	padding: 0 0 0 18px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	font-size: 15px;
	line-height: 1.45;
	color: var(--text-body);
}

/* SDK */
.band > .wrap.sdk {
	flex-direction: row;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
}
.sdk-text { flex: 1 1 420px; display: flex; flex-direction: column; gap: 10px; }
.sdk-text h2 { font-size: clamp(26px, 3vw, 34px); letter-spacing: -0.01em; display: flex; align-items: center; gap: 14px; }
.sdk-text p { font-size: 17px; line-height: 1.55; color: var(--text-muted); }
.sdk-text .fine { font-size: 14px; }
.sdk-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* FAQ */
.faq { display: flex; flex-direction: column; }
.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-child { border-top: 1px solid var(--line); }
.faq summary {
	cursor: pointer;
	list-style: none;
	min-height: 44px;
	padding: 16px 32px 16px 0;
	font-size: 17px;
	font-weight: 600;
	position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
	content: "";
	position: absolute;
	right: 6px;
	top: 50%;
	width: 9px;
	height: 9px;
	border-right: 2px solid var(--text-muted);
	border-bottom: 2px solid var(--text-muted);
	transform: translateY(-70%) rotate(45deg);
	transition: transform 0.15s ease;
}
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq .answer {
	padding: 0 0 20px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	font-size: 16px;
	line-height: 1.6;
	color: var(--text-body);
}

/* ---------- Closing call + downloads ------------------------------------ */

.closing {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 20px;
	padding-top: clamp(64px, 8vw, 104px);
	padding-bottom: clamp(48px, 6vw, 72px);
}
.closing h2 {
	font-size: clamp(32px, 4.5vw, 52px);
	line-height: 1.08;
	letter-spacing: -0.02em;
	max-width: 820px;
}
.closing .whats-new { max-width: 680px; font-size: 16px; color: var(--night-muted); }
.closing .meta { font-size: 14px; color: var(--night-faint); }

.older {
	border-top: 1px solid #1f2733;
	padding-top: 32px;
	padding-bottom: 40px;
}
.older h3 {
	font-size: 14px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--night-faint);
	margin-bottom: 16px;
}
.older ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
}
@media (max-width: 760px) {
	.older ul { grid-template-columns: 1fr; }
}
.older li {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 12px 14px;
	background: var(--night-raised);
	border: 1px solid #1f2733;
	border-radius: var(--radius);
}
/* Versions before 3 are retired: their icon fades to amber. */
.older li img { flex: none; filter: grayscale(1) sepia(0.2); }
.older li div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.older li strong { font-size: 15px; color: var(--night-text); }
.older li span { font-size: 13px; color: var(--night-faint); }

.closing-icon { width: 96px; height: 96px; }

.site-footer { border-top: 1px solid #1f2733; }
.site-footer .wrap {
	padding-top: 24px;
	padding-bottom: 24px;
	display: flex;
	flex-wrap: wrap;
	gap: 12px 24px;
	justify-content: space-between;
	align-items: center;
	font-size: 13px;
	color: var(--night-faint);
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.donate { display: flex; align-items: center; gap: 8px; }
.donate form { margin: 0; }

/* ---------- Legal pages (legal.html, privacy_policy_mas.html) ------------ */

/* Prose, not a stack of blocks: no flex gap from .band > .wrap. */
.band > .wrap.legal {
	display: block;
	max-width: 820px;
	padding-top: clamp(40px, 5vw, 64px);
	padding-bottom: clamp(56px, 7vw, 96px);
	font-size: 15px;
	line-height: 1.6;
	color: var(--text-body);
}
.legal-back { display: inline-block; font-size: 14px; color: var(--text-muted); text-decoration: none; margin-bottom: 24px; }
.legal-back:hover { color: var(--link); }
.legal h1 {
	font-size: clamp(30px, 4vw, 44px);
	line-height: 1.1;
	letter-spacing: -0.015em;
	color: var(--text);
	margin-bottom: 8px;
}
.legal h2 {
	font-size: 17px;
	line-height: 1.3;
	color: var(--text);
	margin: 32px 0 8px;
}
.legal h2.legal-part {
	font-size: clamp(22px, 2.6vw, 28px);
	letter-spacing: -0.01em;
	margin-top: 56px;
	padding-top: 32px;
	border-top: 1px solid var(--line);
}
.legal p, .legal ul { margin: 0 0 12px; }
.legal ul { padding-left: 1.25rem; }
.legal address { font-style: normal; }
.legal address img { display: inline-block; vertical-align: middle; }

/* ---------- Reveal on first scroll -------------------------------------- */

/* The previous site's timing: a one-second fade, the rise easing out. */
.reveal { opacity: 0; transform: translateY(1.5rem); transition: opacity 1s ease, transform 1s cubic-bezier(0.22, 1, 0.36, 1); }
.reveal.revealed { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.reveal { opacity: 1; transform: none; transition: none; }
}
