/*
Theme Name: Corvosight
Theme URI: https://corvosight.com
Author: Corvosight
Description: Custom block theme for corvosight.com. Lean markup, self-hosted fonts, no page builder. Sections are available as block patterns under "Corvosight" in the editor.
Version: 1.0.1
Requires at least: 6.6
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: corvosight
*/

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

/* Smooth anchor jumps, but only for people who haven't asked for less motion */
@media (prefers-reduced-motion: no-preference) {
	html { scroll-behavior: smooth; }
}

body {
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

/* Visible keyboard focus everywhere, in the issue colour so it is never missed */
:where(a, button, summary, input, textarea, select):focus-visible {
	outline: 2px solid var(--wp--preset--color--amber);
	outline-offset: 3px;
	border-radius: 2px;
}

/* Header, main content and footer sit flush against each other; each section sets its own padding */
.wp-site-blocks > * + * { margin-block-start: 0; }

img { height: auto; }

/* ---------- Dark sections ---------- */
/* Any group with the class cs-dark becomes a night-blue band with light text */
.cs-dark {
	background-color: var(--wp--preset--color--night);
	color: var(--wp--preset--color--mist);
}
.cs-dark :where(h1, h2, h3, h4, h5, h6) { color: var(--wp--preset--color--white); }
.cs-dark a:where(:not(.wp-element-button)) { color: var(--wp--preset--color--sky); }
.cs-dark .cs-muted { color: var(--wp--preset--color--slate); }
.cs-muted { color: var(--wp--preset--color--graphite-soft); }

/* Outline buttons: quiet secondary action, readable on both backgrounds */
.wp-block-button.is-style-outline > .wp-block-button__link {
	background: transparent;
	color: var(--wp--preset--color--graphite);
	border: 1.5px solid currentColor;
	padding-top: calc(0.8rem - 1.5px);
	padding-bottom: calc(0.8rem - 1.5px);
}
.cs-dark .wp-block-button.is-style-outline > .wp-block-button__link,
.site-header .wp-block-button.is-style-outline > .wp-block-button__link {
	color: var(--wp--preset--color--mist);
	border-color: var(--wp--preset--color--line);
}
.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	border-color: var(--wp--preset--color--sky);
	color: var(--wp--preset--color--sky);
	background: transparent;
}

/* ---------- Header ---------- */
.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: rgba(11, 18, 32, 0.92);
	-webkit-backdrop-filter: saturate(140%) blur(10px);
	backdrop-filter: saturate(140%) blur(10px);
	border-bottom: 1px solid var(--wp--preset--color--line);
	color: var(--wp--preset--color--mist);
}
/* WordPress's admin bar sits above the header when you're logged in */
.admin-bar .site-header { top: var(--wp-admin--admin-bar--height, 32px); }
@media (max-width: 600px) { .admin-bar .site-header { top: 0; } }

.site-header a { color: var(--wp--preset--color--mist); text-decoration: none; }
.site-header a:hover { color: var(--wp--preset--color--white); }
.site-header .wp-block-site-title a { color: var(--wp--preset--color--white); }
.site-header .wp-block-button__link { padding: 0.55rem 1rem; font-size: 0.92rem; }
.site-header .cs-brand { gap: 0.6rem; }
.site-header .cs-brand img { width: 28px; height: 28px; display: block; }

/* Mobile menu overlay matches the dark header */
.site-header .wp-block-navigation__responsive-container.is-menu-open {
	background-color: var(--wp--preset--color--night);
	color: var(--wp--preset--color--mist);
	padding: 1.5rem;
}
.site-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	font-size: 1.25rem;
	padding: 0.4rem 0;
}

/* ---------- Footer ---------- */
.site-footer a { color: var(--wp--preset--color--mist); text-decoration: none; }
.site-footer a:hover { color: var(--wp--preset--color--sky); text-decoration: underline; }
.site-footer .cs-footer-heading {
	font-family: var(--wp--preset--font-family--manrope);
	font-weight: 700;
	color: var(--wp--preset--color--white);
	font-size: 0.95rem;
	letter-spacing: 0;
	margin-bottom: 0.75rem;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: 0 0 0.5rem; font-size: 0.93rem; }

/* ---------- Hero ---------- */
.cs-hero {
	position: relative;
	overflow: hidden;
}
/* Faint survey grid behind the hero: the site seen from above */
.cs-hero::before {
	content: "";
	position: absolute;
	inset: 0;
	background-image:
		linear-gradient(rgba(76, 194, 255, 0.06) 1px, transparent 1px),
		linear-gradient(90deg, rgba(76, 194, 255, 0.06) 1px, transparent 1px);
	background-size: 48px 48px;
	-webkit-mask-image: radial-gradient(ellipse at 70% 40%, #000 20%, transparent 75%);
	mask-image: radial-gradient(ellipse at 70% 40%, #000 20%, transparent 75%);
	pointer-events: none;
}
.cs-hero > * { position: relative; }
.cs-hero h1 {
	font-size: clamp(2.6rem, 5.6vw, 4.5rem);
	line-height: 1.02;
	letter-spacing: -0.035em;
	max-width: 13ch;
}
.cs-hero .cs-lede {
	font-size: var(--wp--preset--font-size--medium);
	color: var(--wp--preset--color--mist);
	max-width: 34ch;
}
.cs-hero .cs-map img { width: 100%; max-width: 560px; margin-left: auto; display: block; }

/* A screenshot that hangs off the bottom of a dark band into the next section */
.cs-lift-band { padding-bottom: clamp(7rem, 16vw, 13rem) !important; }
.cs-lift { margin-top: calc(-1 * clamp(6rem, 14vw, 11rem)) !important; position: relative; z-index: 2; }

/* ---------- Mac window frame (block style for Image) ---------- */
.wp-block-image.is-style-cs-window {
	background: var(--wp--preset--color--deck);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius--medium);
	padding-top: 30px;
	position: relative;
	box-shadow: 0 30px 60px -20px rgba(4, 8, 16, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
	overflow: hidden;
}
/* The three traffic-light dots */
.wp-block-image.is-style-cs-window::before {
	content: "";
	position: absolute;
	top: 11px;
	left: 14px;
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: #ff5f57;
	box-shadow: 15px 0 0 #febc2e, 30px 0 0 #28c840;
}
.wp-block-image.is-style-cs-window img { display: block; width: 100%; border-radius: 0; }
.wp-block-image.is-style-cs-window figcaption {
	background: var(--wp--preset--color--deck);
	color: var(--wp--preset--color--slate);
	margin: 0;
	padding: 0.6rem 1rem;
	font-size: 0.85rem;
	text-align: left;
}

/* ---------- Feature rows ---------- */
.cs-feature-row { align-items: center !important; }
.cs-feature-row h3 { margin-top: 0; }
.cs-ticks { list-style: none; padding-left: 0; }
.cs-ticks li {
	position: relative;
	padding-left: 1.6rem;
	margin-bottom: 0.55rem;
}
/* Small crawled-node marker instead of a bullet */
.cs-ticks li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.55em;
	width: 9px;
	height: 9px;
	border-radius: 50%;
	border: 2px solid var(--wp--preset--color--sky-deep);
}
.cs-dark .cs-ticks li::before { border-color: var(--wp--preset--color--sky); }

/* ---------- Problem: the tool stack ---------- */
.cs-stack {
	border-top: 1px solid #d9e0ea;
}
.cs-stack-row {
	border-bottom: 1px solid #d9e0ea;
	padding: 1rem 0 !important;
	gap: 1rem;
}
.cs-stack-row p { margin: 0; }
.cs-stack-row .cs-stack-tool { font-weight: 600; font-family: var(--wp--preset--font-family--manrope); }
.cs-stack-total {
	font-family: var(--wp--preset--font-family--manrope);
	font-weight: 800;
	font-size: var(--wp--preset--font-size--large);
	letter-spacing: -0.02em;
}

/* ---------- Capability grid ---------- */
.cs-cap {
	border-top: 2px solid var(--wp--preset--color--line);
	padding-top: 1rem;
}
.cs-cap h4 { margin: 0 0 0.4rem; font-size: 1.05rem; }
.cs-cap p { margin: 0; font-size: 0.95rem; }
.cs-dark .cs-cap p { color: var(--wp--preset--color--slate); }
.cs-light-caps .cs-cap { border-top-color: #d3dbe6; }
.cs-light-caps .cs-cap p { color: var(--wp--preset--color--graphite-soft); }

/* ---------- Privacy split ---------- */
.cs-where {
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius--medium);
	padding: 1.5rem !important;
}
.cs-where h4 { margin-top: 0; }
.cs-where--mac { border-color: var(--wp--preset--color--sky); }

/* ---------- Pricing ---------- */
.cs-plans { gap: 1.25rem !important; }
.cs-plan {
	background: var(--wp--preset--color--white);
	border: 1px solid #d9e0ea;
	border-radius: var(--wp--custom--radius--medium);
	padding: 1.75rem !important;
	display: flex;
	flex-direction: column;
}
.cs-plan h3 { margin: 0; }
.cs-plan .cs-price {
	font-family: var(--wp--preset--font-family--manrope);
	font-weight: 800;
	font-size: 2.25rem;
	letter-spacing: -0.03em;
	margin: 0.75rem 0 0;
	color: var(--wp--preset--color--graphite);
}
.cs-plan .cs-price small { font-size: 0.95rem; font-weight: 500; color: var(--wp--preset--color--graphite-soft); letter-spacing: 0; }
.cs-plan .wp-block-buttons { margin-top: auto; padding-top: 1.25rem; }
.cs-plan--featured {
	border: 2px solid var(--wp--preset--color--sky-deep);
	box-shadow: 0 20px 40px -24px rgba(10, 111, 168, 0.45);
}
.cs-plan-note { font-size: 0.85rem; color: var(--wp--preset--color--sky-deep); font-weight: 600; margin: 0; }

/* ---------- FAQ (Details block) ---------- */
.cs-faq .wp-block-details {
	border-bottom: 1px solid #d9e0ea;
	padding: 1.1rem 0;
}
.cs-faq .wp-block-details:first-child { border-top: 1px solid #d9e0ea; }
.cs-faq summary {
	font-family: var(--wp--preset--font-family--manrope);
	font-weight: 700;
	font-size: 1.1rem;
	cursor: pointer;
	list-style: none;
	position: relative;
	padding-right: 2rem;
}
.cs-faq summary::-webkit-details-marker { display: none; }
.cs-faq summary::after {
	content: "+";
	position: absolute;
	right: 0.25rem;
	top: -0.1rem;
	font-size: 1.4rem;
	font-weight: 400;
	color: var(--wp--preset--color--sky-deep);
}
.cs-faq details[open] summary::after { content: "\2212"; }
.cs-faq .wp-block-details > :not(summary) { margin-top: 0.75rem; max-width: 68ch; }

/* ---------- Bot / code callouts ---------- */
.cs-ua {
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	background: var(--wp--preset--color--deck);
	color: var(--wp--preset--color--sky);
	padding: 1rem 1.25rem !important;
	border-radius: var(--wp--custom--radius--small);
	font-size: 0.95rem;
	overflow-wrap: anywhere;
}

/* ---------- Docs layout ---------- */
.cs-docs-nav h4 { font-size: 0.95rem; margin: 1.5rem 0 0.5rem; }
.cs-docs-nav h4:first-child { margin-top: 0; }
.cs-docs-nav ul { list-style: none; padding: 0; margin: 0; }
.cs-docs-nav li { margin: 0 0 0.4rem; font-size: 0.93rem; }
.cs-docs-nav a { text-decoration: none; color: var(--wp--preset--color--graphite-soft); }
.cs-docs-nav a:hover { color: var(--wp--preset--color--sky-deep); text-decoration: underline; }
@media (min-width: 782px) {
	.cs-docs-nav { position: sticky; top: 6rem; }
}

/* ---------- Blog cards ---------- */
.cs-post-list .wp-block-post { border-top: 1px solid #d9e0ea; padding-top: 1.25rem; }
.cs-post-list .wp-block-post-title a { text-decoration: none; color: var(--wp--preset--color--graphite); }
.cs-post-list .wp-block-post-title a:hover { color: var(--wp--preset--color--sky-deep); }

/* ---------- Small screens ---------- */
@media (max-width: 781px) {
	.cs-hero .cs-map img { margin: 0 auto; max-width: 420px; }
	.cs-feature-row.cs-reverse { flex-direction: column-reverse; }
}

/* Narrow text inside a wide constrained band stays on the band's left edge instead of centring */
.cs-hero.is-layout-constrained > :where(h1, h2, .cs-lede, p, .wp-block-buttons) {
	margin-left: max(0px, calc((100% - 1200px) / 2)) !important;
	margin-right: auto !important;
}

/* Header never wraps onto two lines: text stays on one line, and less-used links
   give way on narrower screens (they stay in the footer and the mobile menu) */
.site-header .wp-block-navigation-item__content,
.site-header .wp-block-button__link { white-space: nowrap; }
.site-header .wp-block-navigation__container { flex-wrap: nowrap; }
@media (min-width: 600px) and (max-width: 1180px) {
	.site-header .wp-block-navigation__container { gap: 1.1rem !important; }
	.site-header .cs-nav-blog { display: none; }
}
@media (min-width: 600px) and (max-width: 940px) {
	.site-header .cs-nav-docs,
	.site-header .cs-nav-login { display: none; }
}
