/* IntonTrainer site layer — layout, wrapping, and visual clarity */

:root {
	--ink: #1f2a30;
	--muted: #5b6b73;
	--line: rgba(31, 42, 48, 0.12);
	--paper: #ffffff;
	--page: #f3f6f7;
	--accent: #2f8f86;
	--accent-dark: #246f68;
	--focus: #3d7cc9;
	--radius: 14px;
	--radius-sm: 10px;
	--shadow: 0 1px 2px rgba(20, 40, 50, 0.05), 0 10px 28px rgba(20, 40, 50, 0.07);
	--space: 0.75rem;
	--gutter: 1.5rem;
}

html {
	scroll-behavior: smooth;
}

body {
	color: var(--ink);
	background: var(--page);
	line-height: 1.65;
}

h1, h2, h3, h4, h5, h6 {
	color: var(--ink);
	line-height: 1.25;
	letter-spacing: -0.02em;
}

p {
	margin: 0 0 1.25em 0;
}

a:focus-visible,
.button:focus-visible {
	outline: 3px solid var(--focus);
	outline-offset: 3px;
}

.button i,
.button .fas,
.button .fab,
.contact-links i {
	margin-right: 0.4em;
}

/* Buttons: wrap-friendly, no clipped labels */
input[type="submit"],
input[type="reset"],
input[type="button"],
button,
.button {
	height: auto;
	min-height: 2.7em;
	line-height: 1.35;
	padding: 0.7em 1.25em;
	border-radius: 999px;
	letter-spacing: 0.02em;
	text-indent: 0;
	text-transform: none;
	white-space: normal;
	font-weight: 600;
	border-bottom: none !important;
	box-shadow: inset 0 0 0 1px rgba(31, 42, 48, 0.22);
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.button.small {
	font-size: 0.82em;
	min-height: 2.35em;
	padding: 0.5em 1em;
}

.button.special {
	background-color: var(--accent);
	box-shadow: none !important;
}

.button.special:hover {
	background-color: var(--accent-dark);
}

.button.special:active {
	background-color: #1d5c56;
}

/* Action rows: real gap on wrap (replaces inline-block + right padding only) */
ul.actions {
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	gap: var(--space) 0.85rem;
	margin: 0 0 1.25em 0;
}

ul.actions li,
ul.actions.small li,
ul.actions.vertical li,
ul.actions.vertical.small li {
	display: block;
	padding: 0 !important;
	width: auto;
	text-align: left;
}

ul.actions li > * {
	margin: 0 !important;
	width: auto;
}

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

ul.actions.uniform li > * {
	min-width: 0;
}

/* Header */
#header {
	padding: 6.5em 1.5em 5em;
}

#header p {
	max-width: 36em;
	margin: 1.1em auto 0;
	font-size: 1.15em;
	line-height: 1.5;
	font-weight: 400;
	color: #ffffff;
	text-shadow: 0 1px 12px rgba(20, 40, 50, 0.28);
}

#header .logo {
	max-height: 108px;
}

#header .inner {
	display: flex;
	flex-direction: column;
	align-items: center;
}

.hero-nav {
	display: inline-flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 0.2rem;
	margin: 2.35em auto 0;
	padding: 0.28rem;
	background: rgba(255, 255, 255, 0.14);
	border: 1px solid rgba(255, 255, 255, 0.32);
	border-radius: 999px;
	box-shadow: 0 10px 30px rgba(20, 40, 50, 0.12);
	backdrop-filter: blur(14px);
}

.hero-nav a {
	border-bottom: none !important;
	color: #ffffff !important;
	padding: 0.55em 1.15em;
	border-radius: 999px;
	font-size: 0.92em;
	font-weight: 600;
	letter-spacing: 0.01em;
	line-height: 1.2;
	white-space: nowrap;
}

.hero-nav a:hover,
.hero-nav a:focus-visible {
	background: rgba(255, 255, 255, 0.22);
	color: #ffffff !important;
}

/* Content sections */
.main {
	padding: 4.5em 0 3.5em;
}

.main.style1 {
	background: var(--paper);
}

.main.style2 {
	background-color: #1f3d4a;
	background-image: linear-gradient(135deg, #2f6f6a 0%, #35548a 72%, #3b3f78 100%);
	background-size: cover;
	color: rgba(255, 255, 255, 0.88);
}

.container {
	width: min(60em, calc(100% - 2 * var(--gutter))) !important;
	max-width: 100%;
	padding-left: 0;
	padding-right: 0;
}

header.major {
	margin: 0 0 1.35em 0;
}

header.major:after {
	width: 3.25em;
	height: 3px;
	margin-top: 1.1em;
	border-radius: 2px;
	background: var(--accent);
}

.main.style2 header.major:after {
	background: #ffffff;
}

.main h3 {
	margin: 1.75em 0 0.7em;
}

.main ul {
	margin: 0 0 1.5em 0;
}

.main ul li {
	padding: 0.35em 0 0.35em 0.35em;
	line-height: 1.55;
}

/* Callout / badge */
.badge-new,
.badge-soon {
	display: inline-block;
	margin-right: 0.5em;
	padding: 0.18em 0.55em;
	border-radius: 999px;
	background: var(--accent);
	color: #ffffff;
	font-size: 0.68em;
	font-weight: 700;
	letter-spacing: 0.06em;
	line-height: 1.4;
	text-transform: uppercase;
	vertical-align: middle;
}

.badge-soon {
	background: #c47a2c;
}

.main.style2 .badge-new {
	background: #ffffff;
	color: var(--accent-dark);
}

.callout {
	margin: 0 0 2em;
	padding: 1.15em 1.2em 1.05em;
	border-radius: var(--radius);
	background: #eef7f5;
	border: 1px solid rgba(47, 143, 134, 0.18);
}

.callout-soon {
	background: #fff8ee;
	border-color: rgba(196, 122, 44, 0.22);
}

.product-card .callout {
	margin: 1.25em 0 1.4em;
}

.product-card .callout h3 {
	font-size: 1.05em;
}

.product-card .callout p {
	color: var(--ink);
}

.button.soon,
.button.soon:hover {
	cursor: default;
	pointer-events: none;
	background: transparent;
	color: var(--muted);
	box-shadow: inset 0 0 0 1px rgba(31, 42, 48, 0.16) !important;
	opacity: 1;
}

.callout > :last-child {
	margin-bottom: 0;
}

.callout h3 {
	margin-top: 0;
}

.catalog {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1.5rem 2rem;
	margin: 0 0 2em;
}

.catalog h3 {
	margin-top: 0;
}

/* Authors */
.people {
	list-style: none;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1rem;
	padding: 0;
	margin: 0 0 0.5em;
}

.people > li {
	list-style: none;
	padding: 1rem 1.1rem;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--paper);
}

.people .role {
	display: block;
	color: var(--muted);
	margin: 0.2em 0 0.65em;
}

.contact-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 0.9rem;
	padding: 0;
	margin: 0;
	list-style: none;
}

.contact-links li {
	padding: 0;
	list-style: none;
}

.contact-links a {
	border-bottom: none;
	font-weight: 600;
	color: var(--accent-dark);
}

.contact-links a:hover {
	color: var(--ink);
}

/* Product cards */
.products {
	background: var(--page);
}

.product-jump {
	margin: 0 0 2.25em;
	padding: 1.15em 1.25em 1.05em;
	background: var(--paper);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
}

.product-jump .row {
	margin: 0;
}

.product-group-title {
	margin: 0.5em 0 0.9em;
}

.product-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1.15rem;
	margin: 0 0 2.25em;
}

.product-card {
	background: var(--paper);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	padding: 1.35rem 1.3rem 1.2rem;
}

.product-card > :last-child {
	margin-bottom: 0;
}

.product-card header.major {
	margin-bottom: 0.85em;
}

.product-card header.major:after {
	display: none;
}

.product-card h3 {
	margin: 0;
	font-size: 1.15em;
}

.product-card .lede,
.product-card p {
	color: var(--muted);
}

.product-card .meta-label {
	margin: 0.15em 0 0.45em;
	font-size: 0.78em;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--muted);
}

.product-card .actions {
	margin-bottom: 0.7em;
}

.product-card .product-links > :last-child {
	margin-bottom: 0;
}

.product-card.featured {
	grid-column: 1 / -1;
	padding: 1.75rem 1.5rem 1.4rem;
	background:
		linear-gradient(180deg, rgba(47, 143, 134, 0.08), rgba(255, 255, 255, 0) 42%),
		var(--paper);
	border-color: rgba(47, 143, 134, 0.22);
}

.product-card.featured h3 {
	font-size: 1.45em;
}

.product-note {
	font-size: 0.95em;
}

/* Papers */
#papers.special,
section.special#papers {
	text-align: left;
}

#papers ul {
	list-style: none;
	padding-left: 0;
}

#papers ul li {
	padding: 0.75em 0;
	border-top: 1px solid var(--line);
}

#papers ul li:first-child {
	border-top: 0;
	padding-top: 0;
}

#papers a {
	font-weight: 600;
	border-bottom-color: rgba(47, 143, 134, 0.35);
}

/* Footer */
#footer {
	padding: 3.5em 1.5em;
}

#footer a {
	border-bottom-color: rgba(255, 255, 255, 0.55);
}

/* Anchors under a possible sticky header later */
[id] {
	scroll-margin-top: 1rem;
}

/* Breakpoints */
@media screen and (max-width: 980px) {
	.catalog,
	.people,
	.product-grid {
		grid-template-columns: 1fr;
	}
}

@media screen and (max-width: 736px) {
	:root {
		--gutter: 1.25rem;
	}

	#header {
		padding: 4em var(--gutter) 3.25em;
	}

	#header p {
		font-size: 1.05em;
	}

	.main {
		padding: 3em 0 2.25em;
	}

	.product-card.featured {
		padding: 1.35rem 1.15rem 1.15rem;
	}

	#footer {
		padding: 3em var(--gutter);
	}
}

@media screen and (max-width: 480px) {
	:root {
		--gutter: 1.25rem;
	}

	ul.actions {
		margin: 0 0 1.25em 0;
	}

	ul.actions li,
	ul.actions.small li {
		display: block;
		width: auto;
		flex: 1 1 100%;
		padding: 0 !important;
		text-align: left;
	}

	ul.actions li > * {
		width: 100%;
	}

	.hero-nav {
		width: 100%;
		max-width: 20.5rem;
		border-radius: 1.35rem;
		gap: 0.1rem;
	}

	.hero-nav a {
		flex: 1 1 calc(50% - 0.1rem);
		text-align: center;
		padding: 0.6em 0.7em;
	}

	.button,
	input[type="submit"],
	input[type="reset"],
	input[type="button"] {
		padding: 0.7em 1em;
	}

	.main {
		padding: 2.4em 0 1.8em;
	}

	#footer {
		padding: 2.4em var(--gutter);
	}
}

.to-top {
	position: fixed;
	right: max(1rem, var(--gutter));
	bottom: max(1rem, var(--gutter));
	z-index: 1000;
	width: 2.85rem;
	height: 2.85rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 999px;
	background: var(--accent);
	color: #ffffff !important;
	border-bottom: none !important;
	box-shadow: 0 10px 28px rgba(20, 40, 50, 0.22);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translateY(0.55rem);
	transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease, background-color 0.2s ease;
}

.to-top.is-visible {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: none;
}

.to-top:hover,
.to-top:focus-visible {
	background: var(--accent-dark);
	color: #ffffff !important;
}

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