/* Shared reading and interaction rules for the home page and gallery. */
html { scrollbar-gutter: stable; }
img { max-width: 100%; }
a, button { touch-action: manipulation; }
h1, h2, h3 { text-wrap: balance; }
.section > *, .hero-main > *, .identity, .nav { min-width: 0; }
.body-copy, .about-copy, .roman, .email, .footer { overflow-wrap: anywhere; }
.nav a { min-height: 44px; display: inline-flex; align-items: center; }
.nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 7px; }
.socials a { display: inline-flex; align-items: center; min-height: 44px; }
.theme { width: 44px; height: 44px; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 2; }
.skip:focus { z-index: 20; }
.section { scroll-margin-top: 24px; }
.wrap { padding-left: max(34px, env(safe-area-inset-left)); padding-right: max(34px, env(safe-area-inset-right)); }

@media (max-width: 650px) {
    .wrap { padding-left: max(20px, env(safe-area-inset-left)); padding-right: max(20px, env(safe-area-inset-right)); }
    .header { height: auto; min-height: 100px; padding: 18px 0 10px; gap: 10px; flex-direction: column; align-items: stretch; }
    .identity { align-self: flex-start; }
    .handle { display: inline; }
    .nav { width: 100%; justify-content: space-between; flex-wrap: wrap; gap: 0 12px; font-size: 13px; }
    .nav a::after { bottom: 5px; }
    .hero-main { gap: 12px; }
    h1 { font-size: clamp(28px, 7.8vw, 36px); }
    .intro { font-size: clamp(17px, 4.5vw, 19px); letter-spacing: .025em; }
    .theme { right: max(18px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom)); }
    .footer { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
