/*!
 * Dr Hoa — homepage sections. Ported from the approved prototype.
 * Loaded only on the front page; grows section by section.
 *
 * 01–04 — built.
 * 05–08 — pending build steps.
 */

/* The homepage owns its section rhythm — sections butt together with dashed rules. */
.home .site-main {
	padding-block: 0;
}

/* --------------------------------------------------------------------------
 * Decorative section number — hand-drawn double oval.
 * ----------------------------------------------------------------------- */

.num {
	position: relative;
	width: 38px;
	height: 38px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: var(--font-serif);
	font-size: 1rem;
	color: var(--ink-muted);
	font-weight: 400;
	line-height: 1;
}

.num::before {
	content: "";
	position: absolute;
	inset: -2px;
	border: 1px dashed rgba(180, 146, 79, .5);
	border-radius: 53% 47% 50% 50% / 47% 53% 49% 51%;
	transform: rotate(-9deg);
}

.num::after {
	content: "";
	position: absolute;
	inset: 3px;
	border: .5px solid rgba(180, 146, 79, .24);
	border-radius: 49% 51% 46% 54% / 54% 46% 52% 48%;
	transform: rotate(15deg);
}

/* The number of the section crossing mid-screen lights up:
   the figure turns teal, the sketched rings turn gold and glow. */
.num,
.num::before,
.num::after {
	transition:
		color .6s ease,
		border-color .6s ease,
		box-shadow .6s ease,
		transform .8s var(--ease-out-soft);
}

.num.is-active {
	color: var(--teal-deep);
}

.num.is-active::before {
	border-color: rgba(180, 146, 79, .9);
	box-shadow: 0 0 16px rgba(180, 146, 79, .28);
	transform: rotate(-3deg) scale(1.06);
}

.num.is-active::after {
	border-color: rgba(180, 146, 79, .5);
	transform: rotate(22deg);
}

/* --------------------------------------------------------------------------
 * Homepage section shell — three columns: number, title, content.
 * ----------------------------------------------------------------------- */

.home-section {
	display: grid;
	grid-template-columns: 38px 255px minmax(0, 1fr);
	gap: 42px;
	padding: 30px var(--gutter) 34px;
	border-bottom: 1px dashed var(--sketch);
	position: relative;
}

/* Small gold cross marking the centre of each section rule. */
.home-section::after {
	content: "";
	position: absolute;
	left: 50%;
	bottom: -5px;
	width: 11px;
	height: 11px;
	transform: translateX(-50%);
	background:
		linear-gradient(var(--gold), var(--gold)) center / 11px 1px no-repeat,
		linear-gradient(var(--gold), var(--gold)) center / 1px 11px no-repeat;
	opacity: .45;
	z-index: 1;
	pointer-events: none;
}

/* Scroll reveal — the class pair is applied by home.js. */
.will-reveal {
	opacity: 0;
	transform: translateY(14px);
	transition: opacity .7s var(--ease-out-soft), transform .7s var(--ease-out-soft);
}

.will-reveal.is-revealed {
	opacity: 1;
	transform: none;
}

/* --------------------------------------------------------------------------
 * 01 Integrated Pain Medicine
 * ----------------------------------------------------------------------- */

.hero {
	--section-one-lift: 0 1px 2px color-mix(in srgb, var(--charcoal) 5%, transparent), 0 8px 20px color-mix(in srgb, var(--gold) 13%, transparent);
	--portrait-frame-gap: 8px;
	display: grid;
	grid-template-columns: 38px minmax(0, 1fr) minmax(400px, 520px);
	column-gap: 32px;
	align-items: stretch;
	padding: 48px var(--gutter) 44px;
	border-bottom: 1px dashed var(--sketch);
	min-height: 420px;
	position: relative;
}

.hero > .num {
	margin-top: 5px;
}

.hero-editorial,
.hero-copy {
	min-width: 0;
}

.hero-editorial {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
}

.hero-copy {
	padding-top: 1px;
}

/* Large dashed construction circle behind the photo column. */
.hero::before {
	content: "";
	position: absolute;
	right: -120px;
	top: -140px;
	width: 620px;
	height: 620px;
	border: .5px dashed rgba(180, 146, 79, .34);
	border-radius: 50%;
	pointer-events: none;
}

/* Vertical construction rail dropping from the "1" marker — a faint
   Da Vinci guide line down the left edge of the plate. */
.hero::after {
	content: "";
	position: absolute;
	left: calc(var(--gutter) + 19px);
	top: 104px;
	bottom: 46px;
	width: 1px;
	background: repeating-linear-gradient(180deg, rgba(180, 146, 79, .38) 0 3px, transparent 3px 9px);
	-webkit-mask-image: linear-gradient(180deg, #000 0, #000 82%, transparent);
	mask-image: linear-gradient(180deg, #000 0, #000 82%, transparent);
	opacity: .55;
	z-index: 0;
	pointer-events: none;
}

.hero h1 {
	margin: 0;
	font-size: clamp(2rem, 1.35rem + 2.6vw, 3.25rem);
	line-height: 1.03;
	text-transform: uppercase;
}

.hero .subtitle {
	margin: 5px 0 0;
	font-size: clamp(1.1875rem, 1rem + .8vw, 1.6875rem);
	line-height: 1.1;
}

/* Shared surveyor mark beneath the opening line of Sections 01–02. */
.hero .subtitle::after,
.ipm-head .section-title::after {
	content: "";
	display: block;
	margin-top: 16px;
	width: 58px;
	height: 7px;
	background:
		radial-gradient(circle at 3.5px 3.5px, transparent 2.1px, var(--gold) 2.5px, var(--gold) 3.2px, transparent 3.6px) 0 0 / 7px 7px no-repeat,
		linear-gradient(var(--gold), var(--gold)) 13px 3px / 45px 1px no-repeat;
	opacity: .75;
}

.hero .lead {
	margin: 30px 0 0;
	max-width: 42ch;
	font-size: clamp(1rem, .9rem + .55vw, 1.375rem);
	line-height: 1.32;
}

.hero .lead span {
	display: block;
}

.hero .lead span + span {
	margin-top: 2px;
}

/* Credential list — stone tablets. Each line is a small carved plate:
   the figure is cut into the stone, the text stands beside it. */
.cred-cards {
	margin: 30px 0 0;
	padding: 0;
	list-style: none;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0;
	border-block: 1px solid var(--rule);
}

/* The approach completes the left-hand editorial column while the portrait
   holds the right. Space alone separates it from the credential ledger. */
.hero-editorial > .dhpc-accordion {
	position: relative;
	margin-top: 30px;
}

/* Quiet ledger lines: no plates or fills; the figures are carved directly
   into the page and remain secondary to the section's positioning copy. */
.cred-card {
	position: relative;
	display: grid;
	grid-template-columns: 56px minmax(0, 1fr);
	align-items: center;
	min-height: 72px;
	padding: 10px 12px 10px 0;
	transition: transform .4s var(--ease-out-soft);
}

.cred-card + .cred-card {
	border-top: 0;
}

.cred-card:nth-child(even) {
	padding-left: 12px;
	border-left: 1px dashed var(--sketch-soft);
}

.cred-card:nth-child(n + 3) {
	border-top: 1px dashed var(--sketch-soft);
}

/* Engraved circular seals, inspired by anatomical and astronomical studies. */
/* The figure — carved into the stone: tone of the plate itself,
   a light catch below the cut and a shadow above it. */
.cred-card-figure {
	text-align: center;
	min-width: 0;
}

.cred-card-value {
	display: block;
	font-family: var(--font-serif);
	font-size: 1.6875rem;
	font-weight: 500;
	line-height: 1;
	color: #D4C8B1;
	text-shadow:
		0 1px 0 rgba(255, 255, 255, .95),
		0 -1px 0 rgba(30, 34, 35, .3);
	transition: color .35s ease;
}

/* The unit, chiselled small caps beneath the figure — inherits the cut. */
.cred-card-value em {
	display: block;
	margin-top: 2px;
	font-style: normal;
	font-size: .53125rem;
	font-weight: 600;
	letter-spacing: .22em;
	text-transform: uppercase;
}

.cred-card-rule {
	display: none;
}

/* Text beside a dashed ledger divider. */
.cred-card-label {
	min-width: 0;
	align-self: stretch;
	display: flex;
	align-items: center;
	margin-left: 8px;
	padding-left: 12px;
	border-left: 1px dashed var(--sketch-soft);
	font-size: .78125rem;
	line-height: 1.45;
	color: var(--charcoal);
}

@media (hover: hover) {
	/* The line lifts a touch and the carving deepens. */
	.cred-card:hover {
		transform: translateY(-2px);
	}

	.cred-card:hover .cred-card-value {
		color: #C3B493;
	}
}

/* Photo plate with one outer rule, an inset mount and drafting corners. */
.photo-placeholder {
	position: relative;
	width: 100%;
	max-width: 520px;
	min-width: 0;
	min-height: 0;
	align-self: stretch;
	justify-self: end;
	margin: 20px 0 9px;
	border: 1px solid var(--rule);
	background: linear-gradient(160deg, #F3EFE8, #FBF9F5);
	box-shadow: var(--section-one-lift);
	padding: var(--portrait-frame-gap);
	display: flex;
	flex-direction: column;
}

.photo-placeholder::before,
.photo-placeholder::after,
.corner::before,
.corner::after {
	content: "";
	position: absolute;
	width: 26px;
	height: 26px;
	border-color: rgba(180, 146, 79, .55);
	border-style: solid;
	pointer-events: none;
	z-index: 2;
}

.photo-placeholder::before { top: var(--portrait-frame-gap); left: var(--portrait-frame-gap); border-width: 1px 0 0 1px; }
.photo-placeholder::after { top: var(--portrait-frame-gap); right: var(--portrait-frame-gap); border-width: 1px 1px 0 0; }
.corner::before { left: var(--portrait-frame-gap); bottom: var(--portrait-frame-gap); border-width: 0 0 1px 1px; }
.corner::after { right: var(--portrait-frame-gap); bottom: var(--portrait-frame-gap); border-width: 0 1px 1px 0; }

/* One-record track today; ready for controls when further profiles exist. */
.doctor-portraits {
	position: absolute;
	inset: var(--portrait-frame-gap);
	display: flex;
	min-width: 0;
	min-height: 0;
	overflow: hidden;
	padding: var(--portrait-frame-gap);
}

.doctor-portraits__track {
	display: flex;
	width: 100%;
	height: 100%;
}

.doctor-portrait {
	min-width: 0;
	min-height: 0;
	flex: 0 0 100%;
	display: grid;
	grid-template-rows: minmax(0, 1fr) auto;
}

.hero-photo {
	position: relative;
	min-height: 0;
	height: 100%;
	overflow: hidden;
	margin: 0;
	box-shadow: none;
}

.hero-photo img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center top;
	filter: saturate(.97) contrast(1.02);
}

.hero-photo::after {
	content: "";
	position: absolute;
	inset: 0;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35);
	pointer-events: none;
}

.photo-caption {
	min-height: 54px;
	padding: 10px 8px 12px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	text-align: center;
	font-size: .625rem;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--charcoal);
}

.photo-caption .muted {
	display: block;
	margin-top: 2px;
	font-size: .5625rem;
	letter-spacing: .06em;
	text-transform: none;
	color: var(--ink-muted);
}

.photo-caption a {
	color: inherit;
	text-decoration: none;
}

.photo-caption a:focus-visible {
	outline: 1px solid var(--gold);
	outline-offset: 3px;
}

/* Proportion sketch pinned past the photo plate's top-right corner. */
.hero-sketch {
	position: absolute;
	top: -24px;
	right: -18px;
	width: 172px;
	height: 172px;
	color: var(--gold);
	opacity: .55;
	pointer-events: none;
	z-index: 1;
}

/* Vertical figure annotation along the right edge. */
.photo-annotation {
	position: absolute;
	top: 62px;
	right: -26px;
	writing-mode: vertical-rl;
	font-family: var(--font-serif);
	font-style: italic;
	font-size: .65625rem;
	letter-spacing: .09em;
	color: var(--gold);
	pointer-events: none;
}

/* Entrance choreography — global reduced-motion rule disables all of it. */
@keyframes rise {
	from {
		opacity: 0;
		transform: translateY(16px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

.hero h1,
.hero .subtitle,
.hero .lead,
.hero .dhpc-accordion,
.hero .cred-cards,
.hero .photo-placeholder {
	animation: rise .8s var(--ease-out-soft) both;
}

.hero .subtitle { animation-delay: .08s; }
.hero .lead { animation-delay: .16s; }
.hero .cred-cards { animation-delay: .24s; }
.hero .dhpc-accordion { animation-delay: .4s; }
.hero .photo-placeholder { animation: rise .9s .22s var(--ease-out-soft) both; }

/* Responsive. */
@media (max-width: 1180px) and (min-width: 901px) {
	.hero {
		grid-template-columns: 38px minmax(0, 1fr) minmax(370px, 42%);
		column-gap: 28px;
	}

	.cred-card {
		grid-template-columns: 52px minmax(0, 1fr);
		padding-right: 8px;
	}

	.cred-card:nth-child(even) {
		padding-left: 8px;
	}

	.cred-card-label {
		margin-left: 6px;
		padding-left: 10px;
		font-size: .71875rem;
	}
}

@media (max-width: 900px) {
	.hero {
		display: flex;
		flex-direction: column;
		gap: 24px;
		padding: 32px 20px 42px;
		min-height: 0;
	}

	.hero::before {
		right: -170px;
		top: auto;
		bottom: -80px;
		width: 420px;
		height: 420px;
	}

	.hero > .num {
		display: none;
	}

	.hero::after {
		display: none;
	}

	.hero .lead {
		margin-top: 16px;
		max-width: none;
		line-height: 1.5;
	}

	.cred-cards {
		margin-top: 30px;
	}

	.hero-editorial > .dhpc-accordion {
		margin-top: 28px;
	}

	.photo-placeholder {
		order: -1;
		width: 100%;
		max-width: 430px;
		min-height: 0;
		align-self: auto;
		margin: 0 auto 4px;
	}

	.doctor-portraits {
		position: relative;
		inset: auto;
	}

	.doctor-portraits,
	.doctor-portraits__track {
		height: auto;
	}

	.doctor-portrait {
		grid-template-rows: auto auto;
	}

	.hero-photo {
		height: auto;
		aspect-ratio: 4 / 5;
	}

	.hero-sketch {
		width: 148px;
		height: 148px;
		top: -24px;
		right: -8px;
	}

	.photo-annotation {
		display: none;
	}

	/* The photo leads the choreography once the composition stacks. */
	.hero .photo-placeholder { animation-delay: .05s; }
	.hero h1 { animation-delay: .16s; }
	.hero .subtitle { animation-delay: .22s; }
	.hero .lead { animation-delay: .28s; }
	.hero .cred-cards { animation-delay: .34s; }
	.hero .dhpc-accordion { animation-delay: .46s; }
}

@media (max-width: 768px) {

	/* Sections stack on small screens. */
	.home-section {
		display: block;
		padding: 28px 20px 32px;
	}

	.home-section::after {
		display: none;
	}

	.home-section > .num {
		display: none;
	}

	.home-section .section-title {
		margin-bottom: 18px;
	}

}

@media (max-width: 480px) {
	.cred-cards {
		grid-template-columns: 1fr;
	}

	.cred-card {
		grid-template-columns: 52px minmax(0, 1fr);
		padding: 8px 2px;
	}

	.cred-card + .cred-card {
		border-top: 1px dashed var(--sketch-soft);
	}

	.cred-card:nth-child(even) {
		padding-left: 2px;
		border-left: 0;
	}

	.cred-card-value {
		font-size: 1.4375rem;
	}

	.cred-card-label {
		margin-left: 8px;
		padding-left: 12px;
	}

	.photo-placeholder {
		--portrait-frame-gap: 7px;
	}
}
