/*
 * bioelectricresearch.com - site stylesheet (2026-11-01 refactor)
 *
 * Mobile-first, Flexbox layout. Replaces the 2012 reset.css + main.css (kept in git at tag
 * v0-faithful-conversion). Colours, fonts and artwork are the original site's.
 *
 * Breakpoints: 600px (large phone / small tablet), 900px (tablet landscape / desktop),
 * 1000px (the Research diagram needs the full site width).
 */

/* ---------- Tokens ---------- */
:root {
	--blue: #2F99DC;          /* links, headings, buttons (original) */
	--blue-dark: #0D77BA;     /* hover (original) */
	--band: #D6EBF8;          /* prescribing-information band (original) */
	--line: #CCCCCC;          /* menu separators (original) */
	--ink: #000000;
	--paper: #FFFFFF;
	--card-top: #FFFFFF;      /* card gradient, sampled from img00_home_callout_bg.png */
	--card-bottom: #DEF0FB;
	--card-edge: #A9D8F3;
	--glow: #1CA3E2;
	--muted-row: #EDF7FC;     /* centre colour of the original card artwork */

	--font: Arial, Helvetica, sans-serif;
	--font-display: "Arial Black", Arial, Helvetica, sans-serif;

	--wrap: 990px;            /* the original site width */
	--gutter: 16px;
	--gap: 24px;
	--radius: 4px;
	--shadow: 0 8px 10px -8px var(--glow);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0; min-height: 100vh; min-height: 100svh;
	display: flex; flex-direction: column;
	background: var(--paper); color: var(--ink);
	font-family: var(--font); font-size: 15px; line-height: 1.5;
}
main { flex: 1 0 auto; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover, a:focus-visible { color: var(--blue-dark); text-decoration: underline; }
:focus-visible { outline: 2px solid var(--blue-dark); outline-offset: 2px; }
h1, h2, h3, h4 { margin: 0 0 12px; font-weight: normal; text-wrap: balance; }
p, ul { margin: 0 0 12px; }
ul { padding-left: 24px; }
ul ul { margin: 6px 0 0; list-style-type: circle; }
li { margin-bottom: 8px; }
sup.reg { font-size: 60%; line-height: 0; vertical-align: super; }
.nowrap, .keep { white-space: nowrap; }

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

.skip-link { position: absolute; left: -10000px; }
.skip-link:focus { left: var(--gutter); top: 8px; z-index: 10; padding: 8px 12px; background: var(--paper); font-size: 15px; line-height: 1.4; }

/* ---------- Header ---------- */
.site-header { background: var(--paper); }
.site-header__inner { display: flex; flex-direction: column; align-items: center; gap: 16px; padding-block: 20px 10px; }
.site-logo img { width: 203px; }
.site-nav { width: 100%; }
.site-nav ul { display: flex; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; }
.site-nav li { flex: 1 1 50%; margin: 0; text-align: center; }
.site-nav li:nth-child(even) { border-left: 1px solid var(--line); }
.site-nav a, .site-nav [aria-current] {
	display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 8px;
	font-family: var(--font-display); font-size: 14px; line-height: 1.3; text-transform: uppercase;
}
.site-nav [aria-current] { color: var(--ink); }

/* ---------- Home hero ---------- */
/* The helix sits behind the device only, so the headline is always on plain black */
.hero { background: var(--ink); color: var(--paper); }
.hero__inner { display: flex; flex-direction: column; align-items: center; gap: 28px; padding-block: 32px 40px; }
.hero__device { position: relative; width: 100%; max-width: 560px; }
.hero__device::before {
	content: ""; position: absolute; inset: -6% 0; z-index: 0;
	background: url(/images/img02_home_helix.webp) no-repeat center / auto 100%;
	-webkit-mask-image: linear-gradient(transparent, #000 22%, #000 78%, transparent);
	mask-image: linear-gradient(transparent, #000 22%, #000 78%, transparent);
}
.hero__device img { position: relative; z-index: 1; }
.hero__text { display: flex; flex-direction: column; align-items: center; gap: 24px; text-align: center; }
.hero h1 { margin: 0; font-weight: bold; }
.hero__line { display: block; }
.hero__line--1 { font-size: 28px; line-height: 1.2; }
.hero__line--2 { font-size: 20px; line-height: 1.4; }
.hero__em { font-size: 22px; line-height: 1.4; }
.hero__line--3 { font-size: 18px; line-height: 1.4; }
.hero__line--4 { font-size: 24px; line-height: 1.3; }
.hero__button {
	display: inline-block; min-height: 64px; padding: 12px 32px;
	border-radius: 12px; background: linear-gradient(#5CB8EF, #1A7FC4 55%, #1570B2);
	box-shadow: 0 0 14px rgba(28, 163, 226, .8);
	color: var(--paper); font-size: 16px; line-height: 1.25; font-weight: bold; text-align: center; text-shadow: 0 0 5px #000000;
	max-width: 260px;
}
.hero__button:hover, .hero__button:focus-visible { color: var(--paper); text-decoration: none; filter: brightness(1.1); }

/* Entrance animation (replaces the 2012 jQuery animation); skipped when motion is reduced */
@media (prefers-reduced-motion: no-preference) {
	.hero__device { animation: device-in 1.1s ease-out both; }
	.hero__line, .hero__button { animation: line-in .8s ease-out both; }
	.hero__line--1 { animation-delay: .5s; }
	.hero__line--2 { animation-delay: .65s; }
	.hero__line--3 { animation-delay: .8s; }
	.hero__line--4 { animation-delay: .95s; }
	.hero__button { animation-delay: 1.2s; }
	@keyframes device-in { from { opacity: 0; transform: scale(.6) rotate(-8deg); } to { opacity: 1; transform: none; } }
	@keyframes line-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
}

/* ---------- Inner-page band ---------- */
.page-band {
	background: var(--ink) url(/images/img00_bodybg_sub_2.webp) no-repeat center -136px / 1920px auto;
	color: var(--paper);
}
.page-band__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--gap); min-height: 150px; padding-block: 24px; }
.page-band h1 {
	margin: 0; font-family: var(--font-display); font-size: 22px; line-height: 1.3; font-weight: bold;
	text-shadow: 0 0 5px #000000;
}
.page-band__device { display: none; }

/* ---------- Content ---------- */
.content { padding-block: 24px 32px; }
.content .wrap { display: flex; flex-direction: column; gap: var(--gap); }
.content .wrap.prose { display: block; }
.prose h2 { color: var(--blue); font-size: 24px; line-height: 1.25; }
.prose h3 { font-size: 20px; line-height: 1.3; font-weight: bold; margin-top: 8px; }
.prose > :last-child { margin-bottom: 0; }

/* Cards (the original gradient boxes) */
.card, .panel, .callout {
	background: linear-gradient(var(--card-top), var(--card-bottom));
	border: 1px solid var(--card-edge); border-radius: var(--radius); box-shadow: var(--shadow);
	padding: 20px;
}
.card > :last-child, .panel > :last-child, .callout > :last-child, .card__body > :last-child, .panel__body > :last-child { margin-bottom: 0; }
.card h2, .panel h2, .callout__title { color: var(--blue); font-size: 22px; line-height: 1.3; }
.card h3 { font-size: 16px; line-height: 1.4; font-weight: bold; margin-bottom: 4px; }

/* Home cards */
.home-features { padding-block: 32px; }
.cards { display: flex; flex-direction: column; gap: var(--gap); }
.card--media { display: flex; flex-direction: column; gap: 16px; }
.card__media { flex: none; align-self: flex-start; }
.card__body { flex: 1 1 auto; min-width: 0; }

.link-download, .link-more, .callout__title a { display: inline-flex; align-items: center; gap: 8px; }
.link-download, .link-more { font-size: 14px; line-height: 1.2; font-weight: bold; text-transform: uppercase; }
.link-download::before { content: ""; flex: none; width: 20px; height: 26px; background: url(/images/img00_download_btn.webp) no-repeat center; }
.link-more::before { content: ""; flex: none; width: 15px; height: 15px; background: url(/images/img00_see_more_btn.webp) no-repeat center; }
.callout__title a::before { content: ""; flex: none; width: 20px; height: 26px; background: url(/images/img00_see_more_btn.webp) no-repeat center; }
.callout__title--download a::before { background-image: url(/images/img00_download_btn.webp); }
.callout__title--plain { font-size: 18px; line-height: 1.3; font-weight: bold; }

/* Panels with a figure */
.panel--figure { display: flex; flex-direction: column; gap: 20px; }
.panel__figure { margin: 0; flex: none; display: flex; justify-content: center; }
.panel__figure img { width: auto; }
.panel__body { flex: 1 1 auto; min-width: 0; }
.panel__row { display: flex; flex-direction: column; gap: 20px; }
.panel__figure--stack { flex-direction: column; align-items: center; gap: 16px; }
.tagline { color: var(--blue); font-size: 22px; line-height: 1.3; }
.reference { margin-top: 12px; font-size: 13px; line-height: 1.5; }

.callouts { display: flex; flex-direction: column; gap: var(--gap); }

/* ---------- System Use steps ---------- */
.step { margin: 0; }
.step + .step { margin-top: 32px; }
.steps.is-paged .step + .step { margin-top: 0; }
.step[hidden] { display: none; }
.step__items { display: flex; flex-direction: column; gap: 24px; }
.step__item { margin: 0; flex: 1 1 0; min-width: 0; }
.step__item img { width: 100%; margin-bottom: 8px; }
.step__item figcaption { font-size: 15px; line-height: 1.5; }
.step__pair { display: flex; gap: 12px; }
.step__pair img { flex: 1 1 0; min-width: 0; }
.step__items--split { align-items: flex-start; }
.step__portrait { width: 240px; }

.pager { display: flex; justify-content: center; align-items: center; gap: 0; margin-top: 24px; }
.pager button {
	min-width: 40px; min-height: 44px; padding: 0 6px; border: 0; border-radius: 6px; background: transparent; cursor: pointer;
	color: var(--blue); font-family: var(--font); font-size: 18px; line-height: 1.2; font-weight: bold;
}
.pager button[aria-current="step"] { background: var(--blue); color: var(--paper); }
.pager button:disabled { opacity: .3; cursor: default; }
.pager .pager__prev, .pager .pager__next { background: no-repeat center; }
.pager .pager__prev { background-image: url(/images/img00_arrow_left.webp); }
.pager .pager__next { background-image: url(/images/img00_arrow_right.webp); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Research ---------- */
.pipeline {
	display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 20px 20px 20px 40px;
	background: linear-gradient(var(--card-top), var(--card-bottom));
	border: 1px solid var(--card-edge); border-radius: var(--radius); box-shadow: var(--shadow);
}
.pipeline__point { margin: 0; font-size: 15px; line-height: 1.4; }
.papers h2 { color: var(--blue); font-size: 16px; line-height: 1.3; font-weight: bold; margin-bottom: 14px; }
.papers ul { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; padding: 0; list-style: none; }
.papers li { margin: 0; flex: 0 0 calc((100% - 24px) / 3); }
.papers img { width: 100%; aspect-ratio: 99 / 130; object-fit: cover; }

/* ---------- About ---------- */
.people { display: flex; flex-direction: column; gap: 4px; }
.person h4 { margin: 0; font-size: 15px; line-height: 1.5; font-weight: bold; }

/* ---------- Site map ---------- */
.sitemap-title { font-size: 24px; line-height: 1.3; }
.sitemap { list-style: none; padding: 0; margin-bottom: 32px; }
.sitemap li { font-size: 18px; line-height: 1.4; }

/* ---------- Contact ---------- */
.contact { display: flex; flex-direction: column; gap: 32px; }
.contact__main { flex: 1 1 auto; min-width: 0; }
.contact__aside { display: flex; flex-direction: column; gap: var(--gap); }
.contact__aside .callout p { font-size: 14px; line-height: 1.4; }

.contact-form { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 14px; line-height: 1.4; font-weight: bold; }
.field input, .field textarea {
	width: 100%; padding: 10px; border: 1px solid #999999; border-radius: var(--radius);
	font-family: var(--font); font-size: 16px; line-height: 1.4; color: var(--ink); background: var(--paper);
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: 2px solid var(--blue); outline-offset: 0; border-color: var(--blue); }
.field__error { color: #CC0000; font-size: 13px; line-height: 1.4; }
.field--trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-actions { display: flex; }
.button {
	display: inline-flex; align-items: center; justify-content: center; min-height: 44px; width: 100%; padding: 10px 24px;
	border: 0; border-radius: var(--radius); background: var(--blue); color: var(--paper); cursor: pointer;
	font-family: var(--font); font-size: 16px; line-height: 1.4; font-weight: bold;
}
.button:hover, .button:focus-visible { background: var(--blue-dark); }
.notice { padding: 12px 16px; border: 1px solid var(--ink); font-weight: bold; font-size: 15px; line-height: 1.5; }

/* ---------- Prescribing information ---------- */
.safety { background: var(--band); padding-block: 24px; font-size: 13px; line-height: 1.5; }
.safety h2 { margin: 0 0 4px; font-size: 13px; line-height: 1.5; font-weight: bold; }
.safety p, .safety ul { margin-bottom: 12px; }
.safety li { margin-bottom: 4px; }
.safety .wrap > :last-child { margin-bottom: 0; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); }
.site-footer ul { display: flex; flex-direction: column; align-items: center; margin: 0 auto; padding-block: 12px; list-style: none; }
.site-footer li { margin: 0; }
.site-footer a { display: block; padding: 12px 16px; color: var(--paper); font-size: 14px; line-height: 1.4; }
.site-footer a:hover, .site-footer a:focus-visible { color: var(--paper); }

/* ==================== 600px and up ==================== */
@media (min-width: 600px) {
	.site-nav li { flex: 1 1 0; }
	.site-nav li + li { border-left: 1px solid var(--line); }

	.hero__line--1 { font-size: 32px; line-height: 1.2; }
	.hero__line--4 { font-size: 28px; line-height: 1.3; }

	.page-band h1 { font-size: 26px; line-height: 1.3; }
	.page-band__inner { min-height: 200px; }

	.card--media { flex-direction: row; gap: 20px; }
	.card__media { width: 110px; object-fit: contain; }

	.panel__row { flex-direction: row; align-items: flex-start; }
	.panel__figure--stack { flex: 0 0 auto; width: 240px; }

	.step__items { flex-direction: row; }
	.step__item--wide { flex: 1 1 100%; }
	.step__items--split { gap: 24px; }

	.callouts { flex-direction: row; flex-wrap: wrap; align-items: flex-start; }
	.callout { flex: 1 1 260px; }
	.papers { flex: 2 1 548px; }
	.papers li { flex: 0 0 100px; }
	.contact__aside { flex-direction: row; }
	.contact__aside .callout { flex: 1 1 0; }

	.button { width: auto; }

	.site-footer ul { flex-direction: row; justify-content: center; flex-wrap: wrap; }
	.site-footer li + li { border-left: 1px solid var(--paper); }
	.site-footer a { padding: 4px 32px; }
}

/* ==================== 900px and up ==================== */
@media (min-width: 900px) {
	.site-header__inner { flex-direction: row; align-items: center; justify-content: space-between; padding-block: 33px 0; min-height: 125px; }
	.site-nav { width: auto; }
	.site-nav li { flex: 0 0 auto; min-width: 140px; }
	.site-nav a, .site-nav [aria-current] { min-height: 70px; padding: 12px 22px; }
	.site-nav li:last-child a { padding-right: 0; }
	.site-nav li:last-child { min-width: 118px; }

	.hero__inner { flex-direction: row; align-items: center; padding-block: 64px; }
	.hero__device { flex: 1 1 60%; max-width: none; margin-left: -24px; }
	.hero__text { flex: 1 1 40%; align-items: center; }
	.hero__line--1 { font-size: 32px; line-height: 1.3; }
	.hero__line--2 { font-size: 20px; line-height: 1.6; }
	.hero__em { font-size: 24px; line-height: 1.6; }
	.hero__line--3 { font-size: 18px; line-height: 1.6; }
	.hero__line--4 { font-size: 28px; line-height: 1.6; }

	.page-band__inner { min-height: 254px; padding-block: 0; }
	.page-band h1 { flex: 1 1 auto; font-size: 32px; line-height: 1.4; }
	.page-band__device { display: block; flex: 0 1 360px; min-width: 0; }

	.content { padding-block: 36px 40px; }
	.prose h2 { font-size: 32px; line-height: 1.25; }

	.cards { flex-direction: row; }
	.panel--figure { flex-direction: row; align-items: flex-start; }
	.panel__figure { flex: 0 0 38%; }
	.panel__figure img { width: 100%; }
	.card { flex: 1 1 0; }

	.content .contact { flex-direction: row; align-items: flex-start; }
	.contact__main { flex: 1 1 auto; }
	.contact__aside { flex: 0 0 300px; flex-direction: column; }

	.site-footer a { padding: 12px 48px; }
}

/* ==================== Research diagram: needs the full site width ==================== */
@media (min-width: 1000px) {
	.pipeline {
		position: relative; display: block; width: 100%; aspect-ratio: 869 / 635; padding: 0; border: 0; border-radius: 0; box-shadow: none; list-style: none;
		background: url(/images/img01_clinical_bubbles.webp) no-repeat center / 100% 100%;
		container-type: inline-size;
	}
	.pipeline__point {
		position: absolute; display: block; padding: 1.6cqw 2cqw;
		border: 0; background: none; color: var(--paper);
		font-size: 1.3cqw; line-height: 1.25;
	}
	/* positions converted from the original pixel layout (869 x 635) */
	.pipeline__point--1 { left: 2.19%;  top: 14.17%; width: 26.35%; height: 23.31%; }
	.pipeline__point--2 { left: 32.45%; top: 16.85%; width: 18.41%; height: 10.4%; }
	.pipeline__point--3 { left: 49.6%;  top: 3.46%;  width: 21.98%; height: 11.8%; }
	.pipeline__point--4 { left: 71%;    top: 16.85%; width: 21.75%; height: 13.9%; }
	.pipeline__point--5 { left: 18.41%; top: 82.68%; width: 26.47%; height: 11.3%; }
	.pipeline__point--6 { left: 49.14%; top: 82.52%; width: 21.98%; height: 13.4%; }
	.pipeline__point--7 { left: 75.6%;  top: 75.43%; width: 21.98%; height: 13.4%; }
}
