fix: stable mobile hero layout - no more page jumping
Changes
@@@ -66,6 +66,7 @@<style>.hero {position: relative;++ min-height: 100vh;min-height: 100svh;padding: 100px 0 40px;overflow: hidden;@@@ -95,10 +96,18 @@grid-template-columns: 1.4fr 1fr;gap: clamp(24px, 4vw, 64px);align-items: center;-- min-height: 70vh;++ min-height: 70svh;}++ /* min-width:0 prevents grid cells from overflowing their track */++ .hero__left, .hero__right { min-width: 0; overflow: hidden; }@media (max-width: 880px) {-- .hero__grid { grid-template-columns: 1fr; }++ .hero__grid {++ grid-template-columns: 1fr;++ min-height: auto;++ padding-bottom: 32px;++ }++ .hero__portrait-frame { animation: none; }++ .hero__portrait { width: min(260px, 65vw); }}.hero__title {@@@ -110,17 +119,19 @@}.hero__role {font-family: var(--font-display);-- font-size: clamp(2.5rem,2.4vw,2.5rem);++ font-size: clamp(1.4rem, 5.5vw, 2.5rem);color: var(--accent);margin: 0 0 1rem;height: 1.6em;overflow: hidden;++ contain: layout style;}.hero__rotator {display: block;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;++ width: 100%;}.hero__lead {max-width: 56ch;
@@ -66,6 +66,7 @@
@@ -66,6 +66,7 @@
<style>
<style>
.hero {
.hero {
position: relative;
position: relative;
+ min-height: 100vh;
min-height: 100svh;
min-height: 100svh;
padding: 100px 0 40px;
padding: 100px 0 40px;
overflow: hidden;
overflow: hidden;
@@ -95,10 +96,18 @@
@@ -95,10 +96,18 @@
grid-template-columns: 1.4fr 1fr;
grid-template-columns: 1.4fr 1fr;
gap: clamp(24px, 4vw, 64px);
gap: clamp(24px, 4vw, 64px);
align-items: center;
align-items: center;
- min-height: 70vh;
+ min-height: 70svh;
}
}
+ /* min-width:0 prevents grid cells from overflowing their track */
+ .hero__left, .hero__right { min-width: 0; overflow: hidden; }
@media (max-width: 880px) {
@media (max-width: 880px) {
- .hero__grid { grid-template-columns: 1fr; }
+ .hero__grid {
+ grid-template-columns: 1fr;
+ min-height: auto;
+ padding-bottom: 32px;
+ }
+ .hero__portrait-frame { animation: none; }
+ .hero__portrait { width: min(260px, 65vw); }
}
}
.hero__title {
.hero__title {
@@ -110,17 +119,19 @@
@@ -110,17 +119,19 @@
}
}
.hero__role {
.hero__role {
font-family: var(--font-display);
font-family: var(--font-display);
- font-size: clamp(2.5rem,2.4vw,2.5rem);
+ font-size: clamp(1.4rem, 5.5vw, 2.5rem);
color: var(--accent);
color: var(--accent);
margin: 0 0 1rem;
margin: 0 0 1rem;
height: 1.6em;
height: 1.6em;
overflow: hidden;
overflow: hidden;
+ contain: layout style;
}
}
.hero__rotator {
.hero__rotator {
display: block;
display: block;
white-space: nowrap;
white-space: nowrap;
overflow: hidden;
overflow: hidden;
text-overflow: ellipsis;
text-overflow: ellipsis;
+ width: 100%;
}
}
.hero__lead {
.hero__lead {
max-width: 56ch;
max-width: 56ch;