/*
 * What theme.json cannot say.
 *
 * Colours are never written as hex here — they come from the presets theme.json
 * generates, so the palette has exactly one definition. A hex in this file is a
 * colour that cannot follow the theme, which is the same rule the app's own
 * styles.css works to.
 */

:root {
	--im-radius: 7px;
	--im-radius-lg: 10px;
	--im-line: var(--wp--preset--color--line);
	--im-ink: var(--wp--preset--color--ink);
	--im-muted: var(--wp--preset--color--muted);
	--im-accent: var(--wp--preset--color--accent);
	--im-accent-ink: var(--wp--preset--color--accent-ink);
	--im-shadow: 0 1px 2px rgb(27 27 31 / 6%), 0 8px 24px rgb(27 27 31 / 6%);
}

/* ---------------------------------------------------------------- header */

/*
 * The bar sticks by its WRAPPER, not by itself.
 *
 * wp:template-part with a tagName wraps the group in its own <header>, and a
 * sticky element only travels inside its parent's box — that wrapper is 98 px
 * tall, so sticking the group inside it pins for 98 px and then scrolls away.
 * Sticking the wrapper is what makes it follow the page.
 */
.wp-site-blocks > header.wp-block-template-part {
	position: sticky;
	top: 0;
	z-index: 40;
}
/* The admin bar is fixed and would sit over the bar for a logged-in editor. */
body.admin-bar .wp-site-blocks > header.wp-block-template-part { top: 32px; }
@media (max-width: 782px) { body.admin-bar .wp-site-blocks > header.wp-block-template-part { top: 46px; } }

.im-header {
	border-bottom: 1px solid var(--im-line);
	padding-block: 0.7rem;
	/*
	 * No backdrop-filter here. A blurred sticky bar looks well, but in Chromium
	 * it promotes the whole page to a compositing layer that stops repainting
	 * once the document is a few thousand pixels tall — the sections below the
	 * fold simply stop being drawn. Measured on this page at 5 200 px. The bar
	 * is opaque white anyway, so the blur was never doing any work.
	 */
}

/*
 * Brand, menu, language — three items in one flexible row.
 *
 * They are siblings rather than two nested groups so that the row can BREAK
 * differently on a phone: brand and language stay on the first line, and the
 * menu drops to a line of its own where it has room to scroll. Nested, the
 * language switch was pushed onto a third line and the bar ate 136 px of a
 * 812 px screen.
 */
.im-header__bar { gap: 0.6rem 1.5rem; width: 100%; }
.im-header__bar .im-nav { margin-left: auto; min-width: 0; }

.im-brand {
	display: inline-flex;
	align-items: center;
	gap: 0.55rem;
	text-decoration: none;
	color: var(--im-ink);
	font-weight: 650;
	font-size: 1.0625rem;
	letter-spacing: -0.02em;
}
.im-brand:hover { text-decoration: none; }
.im-brand.is-dark { color: var(--wp--preset--color--night-text); }
.im-mark { display: block; }

/* -------------------------------------------------------------- the menu */

.im-nav {
	display: flex;
	align-items: center;
	gap: 1.25rem;
	overflow-x: auto;
	scrollbar-width: none;
	max-width: 100%;
}
.im-nav::-webkit-scrollbar { display: none; }

.im-nav__link {
	color: var(--im-muted);
	text-decoration: none;
	font-size: 0.9375rem;
	white-space: nowrap;
	padding-block: 0.25rem;
	border-bottom: 2px solid transparent;
}
.im-nav__link:hover { color: var(--im-ink); text-decoration: none; }
.im-nav__link.is-here { color: var(--im-ink); border-bottom-color: var(--im-accent); }

/* -------------------------------------------------------- the PT/EN pair */

.im-lang {
	display: inline-flex;
	align-items: center;
	gap: 0.15rem;
	border: 1px solid var(--im-line);
	border-radius: 999px;
	padding: 0.15rem;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.03em;
}
.im-lang__on,
.im-lang__off {
	padding: 0.2rem 0.55rem;
	border-radius: 999px;
	text-decoration: none;
	line-height: 1.4;
}
.im-lang__on { background: var(--im-ink); color: var(--wp--preset--color--panel); }
.im-lang__off { color: var(--im-muted); }
.im-lang__off:hover { color: var(--im-ink); background: var(--wp--preset--color--ground); text-decoration: none; }

/* ------------------------------------------------------------- the pages */

.im-main > * { margin-block: 0; }

/*
 * One left edge down the whole page.
 *
 * WordPress centres a constrained block at contentSize and a wide one at
 * wideSize, so a 760 px paragraph sitting above a 1240 px row of cards is
 * indented from it by 240 px and reads as a mistake. Pushing the narrow blocks
 * to where the wide ones start lines the two up, while leaving the measure at
 * 760 px where prose wants it. max() keeps it at 0 inside anything narrower
 * than wideSize — a card, or any screen below 1240 px.
 */
.im-main .is-layout-constrained > :where(:not(.alignwide):not(.alignfull):not(.alignleft):not(.alignright)) {
	/* !important because WordPress's own constrained-layout rule uses it too. */
	margin-left: max(0px, calc((100% - var(--wp--style--global--wide-size)) / 2)) !important;
	margin-right: auto !important;
}

/* A dark band. Everything inside it has to flip, not just the ground. */
.has-night-background-color h1,
.has-night-background-color h2,
.has-night-background-color h3,
.has-night-background-color h4 { color: var(--wp--preset--color--night-text); }
/* Scoped to the page body: the footer has its own, quieter link colour, and
   without the scope this rule out-specifies it and turns the footer orange. */
.im-main .has-night-background-color a:not(.im-btn):not(.im-brand) { color: var(--wp--preset--color--accent); }
.has-night-background-color .im-card {
	background: var(--wp--preset--color--night-panel);
	border-color: var(--wp--preset--color--night-line);
	box-shadow: none;
}
.has-night-background-color .im-card p { color: var(--wp--preset--color--night-muted); }
.has-night-background-color .im-eyebrow { color: var(--wp--preset--color--accent); }

/* An intro paragraph: bigger, quieter, never more than a couple of lines. */
.im-lede {
	font-size: clamp(1.125rem, 0.95rem + 0.7vw, 1.375rem);
	line-height: 1.5;
	color: var(--im-muted);
	max-width: 34em;
}
.has-night-background-color .im-lede { color: var(--wp--preset--color--night-muted); }

.im-eyebrow {
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: var(--im-accent-ink);
	margin-bottom: 0.5rem;
}

/* ------------------------------------------------------------- controls */

.im-btn {
	display: inline-block;
	background: var(--im-accent);
	color: var(--wp--preset--color--on-accent);
	border-radius: var(--im-radius);
	padding: 0.8rem 1.5rem;
	font-weight: 600;
	text-decoration: none;
	border: 1px solid transparent;
	line-height: 1.3;
}
.im-btn:hover { background: #e86212; color: var(--wp--preset--color--on-accent); text-decoration: none; }
.im-btn:focus-visible { outline: 2px solid var(--im-accent-ink); outline-offset: 2px; }

.im-btn.is-quiet {
	background: var(--wp--preset--color--panel);
	color: var(--im-ink);
	border-color: var(--im-line);
}
.im-btn.is-quiet:hover { background: var(--wp--preset--color--ground); color: var(--im-ink); }
.has-night-background-color .im-btn.is-quiet {
	background: transparent;
	color: var(--wp--preset--color--night-text);
	border-color: var(--wp--preset--color--night-line);
}

.im-dl { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; }
.im-dl__note {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.8125rem;
	color: var(--im-muted);
}
.has-night-background-color .im-dl__note { color: var(--wp--preset--color--night-muted); }
.im-dl.is-pending .im-dl__note { opacity: 0.85; }

/* ---------------------------------------------------------------- cards */

.im-cards { --im-gap: 1rem; }
.im-cards .wp-block-column { display: flex; }

.im-card {
	background: var(--wp--preset--color--panel);
	border: 1px solid var(--im-line);
	border-radius: var(--im-radius-lg);
	padding: 1.5rem;
	box-shadow: var(--im-shadow);
	width: 100%;
}
.im-card h3 { margin-top: 0; }
.im-card > :last-child { margin-bottom: 0; }
.im-card p { color: var(--im-muted); font-size: 1rem; }

/* A figure: a screenshot, framed the way the app frames a sheet. */
.im-figure img {
	border: 1px solid var(--im-line);
	border-radius: var(--im-radius-lg);
	box-shadow: var(--im-shadow);
	display: block;
	width: 100%;
	height: auto;
}
.im-figure figcaption {
	font-size: 0.875rem;
	color: var(--im-muted);
	margin-top: 0.75rem;
	text-align: left;
}
/*
 * A dark screenshot on a dark band needs a LIGHT edge, not a shadow.
 *
 * The app opens black, so on the black hero the window melts into the ground
 * and stops reading as a window at all. A drop shadow adds nothing over black;
 * a hairline of light does the whole job, and a wide soft shadow underneath
 * gives it somewhere to sit.
 */
.has-night-background-color .im-figure img {
	border-color: transparent;
	box-shadow:
		0 0 0 1px rgb(255 255 255 / 11%),
		0 18px 50px rgb(0 0 0 / 55%);
}
.has-night-background-color .im-figure figcaption { color: var(--wp--preset--color--night-muted); }

/* The one thing on this site that is a warning and not a feature. */
.im-note {
	background: #fdf5e3;
	border: 1px solid #ecd9a8;
	border-left-width: 3px;
	border-radius: var(--im-radius);
	padding: 1rem 1.25rem;
	color: #6b4b12;
	font-size: 0.9375rem;
}
.im-note strong { color: #5a3f0f; }
.im-note > :last-child { margin-bottom: 0; }

/* ---------------------------------------------------------------- price */

.im-plan { height: 100%; }
.im-price { margin: 0.5rem 0 1rem; display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; }
.im-price__figure { font-size: 2.25rem; font-weight: 680; letter-spacing: -0.03em; color: var(--im-ink); line-height: 1.1; }
.im-price__term { font-size: 0.9375rem; color: var(--im-muted); }
.im-price__ask { font-size: 1.5rem; font-weight: 620; color: var(--im-accent-ink); }

.im-ticks { list-style: none; padding: 0; margin: 0; }
.im-ticks li {
	position: relative;
	padding-left: 1.5rem;
	margin-bottom: 0.55rem;
	font-size: 0.9375rem;
	color: var(--im-muted);
}
.im-ticks li::before {
	content: "";
	position: absolute;
	left: 0; top: 0.55em;
	width: 0.55rem; height: 0.55rem;
	border-radius: 2px;
	background: var(--im-accent);
}
/* A list of things the tool does NOT do: same shape, no accent. */
.im-ticks.is-off li::before,
.im-ticks li.is-off::before { background: var(--im-line); }

/* ----------------------------------------------------------------- form */

.im-form { display: grid; gap: 1rem; max-width: 34rem; }
.im-form label { display: grid; gap: 0.35rem; font-size: 0.9375rem; font-weight: 600; }
.im-form input,
.im-form textarea {
	font: inherit;
	font-size: 1rem;
	padding: 0.7rem 0.85rem;
	border: 1px solid var(--im-line);
	border-radius: var(--im-radius);
	background: var(--wp--preset--color--panel);
	color: var(--im-ink);
	width: 100%;
}
.im-form input:focus-visible,
.im-form textarea:focus-visible { outline: 2px solid var(--im-accent); outline-offset: -1px; border-color: var(--im-accent); }
.im-form textarea { min-height: 8rem; resize: vertical; }
.im-form .im-hint { font-weight: 400; font-size: 0.8125rem; color: var(--im-muted); }
.im-form button { justify-self: start; cursor: pointer; }
/* The honeypot. Off-screen rather than display:none, which some bots skip. */
.im-form .im-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.im-said { border-radius: var(--im-radius); padding: 0.9rem 1.1rem; font-size: 0.9375rem; }
.im-said.is-ok { background: #eaf7ec; border: 1px solid #bfe3c6; color: #1f5c2c; }
.im-said.is-bad { background: #fdecea; border: 1px solid #f3c0bb; color: #8a2b22; }

/* --------------------------------------------------------------- footer */

.im-footer__top { gap: 1.25rem 2rem; align-items: center; }
.im-footer__rule { border-color: var(--wp--preset--color--night-line); margin-block: 1.75rem; opacity: 1; }
.im-footer__legal { gap: 0.5rem 2rem; font-size: 0.875rem; }
.im-footer__legal p, .im-footer .im-contact { margin: 0; font-size: 0.875rem; }
.im-footer-nav { display: flex; flex-wrap: wrap; gap: 0.6rem 1.25rem; }
.im-footer-nav a { color: var(--wp--preset--color--night-muted); text-decoration: none; font-size: 0.9375rem; }
.im-footer-nav a:hover { color: var(--wp--preset--color--night-text); text-decoration: underline; }
.im-footer a { color: var(--wp--preset--color--night-muted); }

/* -------------------------------------------------------------- narrow */

@media (max-width: 781px) {
	.im-header__bar .im-nav {
		order: 3;
		flex-basis: 100%;
		margin-left: 0;
		gap: 1.1rem;
	}
	.im-header__bar .im-lang { margin-left: auto; }
	.im-card { padding: 1.25rem; }
	.im-price__figure { font-size: 1.875rem; }
}

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