/* Editorial home — intentionally scoped so product and legal pages keep their own skins. */
body[data-page="index"] {
    --home-header-height: 78px;
    --home-footer-height: 58px;
    --editorial-display: "Roboto Condensed", "Arial Narrow", Inter, Arial, sans-serif;
    --editorial-paper: #f5f0e6;
    --editorial-paper-deep: #ece3d5;
    --editorial-ink: #082453;
    --editorial-ink-soft: rgba(8, 36, 83, 0.72);
    --editorial-line: rgba(8, 36, 83, 0.75);
    --editorial-teal: #0b9b97;
    --editorial-turquoise: #37cbbd;
    --editorial-gold: #f2b817;
    --editorial-coral: #f05a67;
    --search-mobile-surface: rgba(245, 240, 230, 0.99);
    --search-mobile-input: rgba(255, 255, 255, 0.5);
    --search-mobile-ink: var(--editorial-ink);
    --search-mobile-muted: var(--editorial-ink-soft);
    --search-mobile-line: rgba(8, 36, 83, 0.22);
    --search-mobile-accent: var(--editorial-teal);
    --search-mobile-focus: rgba(11, 155, 151, 0.18);
    --search-mobile-hover: rgba(55, 203, 189, 0.1);
    --muted: var(--editorial-ink-soft);
    --card-bg: transparent;
    --glass-border: rgba(8, 36, 83, 0.16);
    display: flow-root;
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
    color: var(--editorial-ink);
    background:
        radial-gradient(circle at 78% 5%, rgba(55, 203, 189, 0.09), transparent 28rem),
        radial-gradient(circle at 12% 78%, rgba(242, 184, 23, 0.07), transparent 24rem),
        linear-gradient(rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.22)),
        var(--editorial-paper);
    background-attachment: scroll;
}

body[data-page="index"]::before {
    position: fixed;
    z-index: -1;
    inset: 0;
    opacity: 0.22;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.12'/%3E%3C/svg%3E");
    pointer-events: none;
    content: '';
}

body[data-page="index"] .wrap {
    width: 100%;
    max-width: none;
    height: calc(100dvh - var(--home-header-height) - var(--home-footer-height));
    margin: var(--home-header-height) 0 0;
    overflow-x: hidden;
    overflow-y: scroll;
    overscroll-behavior: contain;
    padding: 52px max(48px, calc((100vw - 1536px) / 2 + 72px)) 0;
    scroll-behavior: smooth;
}

body[data-page="index"] a,
body[data-page="index"] button {
    -webkit-tap-highlight-color: transparent;
}

body[data-page="index"] :focus-visible {
    outline: 3px solid var(--editorial-teal);
    outline-offset: 4px;
}

/* Header */
body[data-page="index"] header.topbar {
    top: 0;
    border-bottom: 2px solid var(--editorial-ink);
    background: rgba(245, 240, 230, 0.94);
    box-shadow: 0 8px 32px rgba(8, 36, 83, 0.05);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}

body[data-page="index"] .topbar .inner {
    max-width: none;
    min-height: var(--home-header-height);
    padding: 0 0 0 max(48px, calc((100vw - 1536px) / 2 + 72px));
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

@media (min-width: 1241px) {
    body[data-page="index"] .topbar .inner {
        /* Follow the transformed book cover's visual overhang past the content grid. */
        padding-right: max(4px, calc((100vw - 1536px) / 2 + 37px));
    }
}

body[data-page="index"] .brand {
    gap: 14px;
}

body[data-page="index"] .brand > a:first-child {
    color: inherit;
    text-decoration: none;
}

body[data-page="index"] .brand-monogram {
    display: block;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 18%;
    box-shadow: 0 5px 12px rgba(8, 36, 83, 0.14);
}

body[data-page="index"] .brand-text-group h1 {
    color: var(--editorial-ink);
    font-size: 21px;
    font-weight: 700;
    line-height: 1.1;
}

body[data-page="index"] .brand-text-group span {
    color: var(--editorial-ink-soft);
    font-size: 14px;
}

body[data-page="index"] .brand-tagline--editorial,
body[data-page="index"] .brand-tagline--editorial .brand-role,
body[data-page="index"] .brand-tagline--editorial .brand-role-separator {
    display: inline;
}

body[data-page="index"] .brand-tagline--editorial .brand-role-separator {
    margin: 0 7px;
    color: var(--editorial-teal);
}

body[data-page="index"] .topbar-actions {
    align-self: stretch;
    gap: 0;
}

body[data-page="index"] nav.topnav {
    align-self: stretch;
    align-items: stretch;
    gap: 0;
}

body[data-page="index"] nav.topnav a {
    display: inline-flex;
    min-width: 145px;
    align-items: center;
    justify-content: center;
    padding: 0 24px;
    border-left: 1px solid rgba(8, 36, 83, 0.28);
    border-radius: 0;
    color: var(--editorial-ink);
    font-family: var(--editorial-display);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

body[data-page="index"] nav.topnav a:nth-child(3) {
    min-width: 165px;
}

body[data-page="index"] nav.topnav a:hover {
    background: rgba(8, 36, 83, 0.05);
    color: var(--editorial-teal);
    transform: none;
}

body[data-page="index"] nav.topnav .home-guide-link {
    min-width: 226px;
    gap: 14px;
    border-right: 0;
    background: linear-gradient(105deg, var(--editorial-turquoise), #2eb5b4);
}

body[data-page="index"] nav.topnav .home-guide-link:hover {
    background: linear-gradient(105deg, #48d6c7, #34bdbb);
    color: var(--editorial-ink);
}

body[data-page="index"] .home-guide-arrow {
    font-size: 18px;
    font-weight: 600;
    line-height: 1;
}

body[data-page="index"] .search-btn {
    display: none;
}

body[data-page="index"] .search-btn:hover {
    border-color: var(--editorial-teal);
    background: rgba(11, 155, 151, 0.08);
    color: var(--editorial-teal);
}

/* Main editorial grid */
body[data-page="index"] .home-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(580px, 1fr);
    grid-template-areas: none;
    column-gap: 0;
    row-gap: 0;
    align-items: start;
}

body[data-page="index"] .home-primary,
body[data-page="index"] .home-secondary {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

body[data-page="index"] .home-primary {
    gap: 15px;
    padding-right: 52px;
}

body[data-page="index"] .home-secondary {
    gap: 60px;
}

body[data-page="index"] .home-about {
    grid-area: about;
    display: grid;
    grid-template-columns: minmax(330px, 1.25fr) minmax(220px, 0.72fr);
    gap: clamp(42px, 4vw, 62px);
    align-items: start;
    min-width: 0;
    margin: 0;
    padding-top: 15px;
    scroll-margin-top: 112px;
}

body[data-page="index"] .home-identity {
    min-width: 0;
}

body[data-page="index"] .home-name {
    margin: 0;
    color: var(--editorial-ink);
    font-family: Inter, Arial, sans-serif;
    font-size: clamp(94px, 8.4vw, 128px);
    font-weight: 700;
    letter-spacing: -0.075em;
    line-height: 0.82;
}

body[data-page="index"] .home-name span {
    display: block;
}

body[data-page="index"] .home-role {
    display: flex;
    flex-wrap: wrap;
    gap: 0 9px;
    margin: 24px 0 0;
    padding-top: 16px;
    border-top: 1px solid var(--editorial-line);
    color: var(--editorial-ink);
    font-size: clamp(17px, 1.4vw, 22px);
    letter-spacing: -0.025em;
}

body[data-page="index"] .home-role-dot {
    color: var(--editorial-teal);
}

body[data-page="index"] .profile-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 28px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    cursor: default;
}

body[data-page="index"] .profile-avatar-container {
    float: none;
    width: 214px;
    height: 138px;
    margin: 0;
}

body[data-page="index"] .author-portraits {
    position: relative;
    width: 100%;
    height: 100%;
    isolation: isolate;
}

body[data-page="index"] .author-portrait {
    position: absolute;
    width: 118px;
    height: 118px;
    overflow: hidden;
    border: 3px solid var(--editorial-ink);
    border-radius: 50%;
    background: var(--editorial-paper);
    box-shadow:
        0 0 0 3px var(--editorial-paper),
        0 10px 22px rgba(8, 36, 83, 0.15);
    transition: transform 325ms cubic-bezier(0.22, 1, 0.36, 1);
}

body[data-page="index"] .author-portrait--editorial {
    z-index: 1;
    top: 0;
    left: 0;
}

body[data-page="index"] .author-portrait--photo {
    z-index: 2;
    right: 0;
    bottom: 0;
    border-color: var(--editorial-teal);
}

body[data-page="index"] .profile-avatar {
    display: block;
    width: 100%;
    height: 100%;
    aspect-ratio: 1;
    border: 0;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: none;
}

body[data-page="index"] .profile-avatar--editorial {
    object-position: 50% 48%;
}

body[data-page="index"] .profile-avatar--photo {
    object-position: 50% 50%;
}

body[data-page="index"] .author-portrait-link {
    position: absolute;
    z-index: 3;
    top: 61%;
    left: 50%;
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 3px solid var(--editorial-paper);
    border-radius: 50%;
    color: var(--editorial-ink);
    background: var(--editorial-turquoise);
    box-shadow: 0 5px 13px rgba(8, 36, 83, 0.2);
    pointer-events: none;
    transform: translate(-50%, -50%);
    transition: transform 325ms cubic-bezier(0.22, 1, 0.36, 1);
}

body[data-page="index"] .author-portrait-link svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.25;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@media (hover: hover) and (pointer: fine) {
    body[data-page="index"] .author-portraits:hover .author-portrait--editorial {
        transform: translate(-4px, -3px) rotate(-2deg);
    }

    body[data-page="index"] .author-portraits:hover .author-portrait--photo {
        transform: translate(4px, 3px) scale(1.02);
    }

    body[data-page="index"] .author-portraits:hover .author-portrait-link {
        transform: translate(-50%, -50%) rotate(14deg);
    }
}

body[data-page="index"] .profile-info {
    min-width: 0;
}

body[data-page="index"] .section-title {
    display: block;
}

body[data-page="index"] .section-title--spaced {
    margin-bottom: 18px;
}

body[data-page="index"] .section-title h2 {
    margin: 0;
    padding: 0;
    border: 0;
    color: var(--editorial-teal);
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.02em;
    text-transform: none;
}

body[data-page="index"] .profile-info .lead {
    margin: 0 0 16px;
    color: var(--editorial-ink);
    font-size: 12px;
    line-height: 1.5;
}

body[data-page="index"] .profile-bio {
    max-height: none;
    overflow: visible;
    cursor: default;
}

body[data-page="index"] .profile-bio::after {
    display: none;
}

/* Featured book */
body[data-page="index"] .home-featured {
    grid-area: featured;
    min-width: 0;
    margin: 0;
    padding-left: 32px;
    border-left: 1px solid rgba(8, 36, 83, 0.45);
    scroll-margin-top: 112px;
}

body[data-page="index"] .featured-book {
    display: grid;
    grid-template-columns: 205px minmax(285px, 1fr);
    gap: 24px;
    align-items: start;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    cursor: default;
    transition: none;
}

body[data-page="index"] .featured-book:hover {
    border: 0;
    box-shadow: none;
    transform: none;
}

body[data-page="index"] .featured-book-body {
    min-width: 0;
}

body[data-page="index"] .home-featured .section-title h2 {
    color: var(--editorial-coral);
    font-size: 14px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

body[data-page="index"] [data-featured-heading-mobile] {
    display: none;
}

body[data-page="index"] .featured-book-title,
body[data-page="index"] .featured-book h3 {
    margin: 0;
    color: var(--editorial-ink);
    font-size: clamp(54px, 4.15vw, 66px);
    font-weight: 700;
    letter-spacing: -0.06em;
    line-height: 0.9;
}

body[data-page="index"] .featured-title-rule {
    display: block;
    width: 52px;
    height: 3px;
    margin: 26px 0;
    background: var(--editorial-gold);
}

body[data-page="index"] .featured-book p {
    margin: 0 0 26px;
    color: var(--editorial-ink);
    font-size: 12px;
    line-height: 1.5;
}

body[data-page="index"] .featured-book-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}

body[data-page="index"] .featured-book-cta {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    min-height: 46px;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--editorial-teal);
    color: var(--editorial-ink);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
}

body[data-page="index"] .featured-book-cta--site::after {
    display: none;
}

body[data-page="index"] .featured-book-cta:hover {
    color: var(--editorial-teal);
    text-decoration: none;
}

body[data-page="index"] .featured-book:has(.featured-book-cta--site:focus-visible) {
    outline: 0;
}

body[data-page="index"] .featured-book-cta--site:focus-visible,
body[data-page="index"] .featured-book-cta--amazon:focus-visible {
    border-radius: 0;
    outline: 3px solid var(--editorial-teal);
    outline-offset: 3px;
}

body[data-page="index"] .featured-cta-icon {
    display: inline-flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--editorial-teal);
    color: var(--editorial-teal);
    font-size: 18px;
    line-height: 1;
}

body[data-page="index"] .featured-cta-icon svg {
    width: 18px;
    height: 18px;
}

body[data-page="index"] .featured-cta-arrow {
    font-size: 18px;
    transition: transform 0.18s ease;
}

body[data-page="index"] .featured-book-cta:hover .featured-cta-arrow,
body[data-page="index"] .editorial-project:hover .project-arrow {
    transform: translate(3px, -3px);
}

body[data-page="index"] .featured-book-cta--amazon {
    border-bottom-color: var(--editorial-gold);
}

body[data-page="index"] .featured-cta-icon--amazon {
    border-color: var(--editorial-gold);
    color: #b98100;
}

body[data-page="index"] .featured-book-stage {
    position: relative;
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    margin-right: -24px;
    margin-left: 12px;
    padding: 0 0 24px;
    isolation: isolate;
    perspective: 1300px;
}

body[data-page="index"] .featured-book-stage::after {
    position: absolute;
    z-index: -1;
    right: -64px;
    bottom: -12px;
    left: 38px;
    height: 76%;
    background: var(--editorial-gold);
    box-shadow: inset 0 -1px 0 rgba(8, 36, 83, 0.24);
    content: '';
}

body[data-page="index"] .featured-book-cover-link {
    display: block;
    width: 100%;
    color: inherit;
}

body[data-page="index"] .featured-book-mockup {
    max-width: 340px;
    transform: translate(27px, 21px) perspective(1100px) rotateY(-5deg);
    transform-style: preserve-3d;
    transform-origin: center left;
    transition: transform 0.28s ease;
}

body[data-page="index"] .featured-book-cover-link:hover .featured-book-mockup {
    transform: translate(27px, 16px) perspective(1100px) rotateY(-2deg) scale(1.015);
}

body[data-page="index"] .featured-book-cover {
    border-radius: 1px 4px 4px 1px;
    filter: drop-shadow(18px 22px 15px rgba(8, 36, 83, 0.3));
}

body[data-page="index"] .featured-book-pages {
    top: 1.4%;
    right: -0.82rem;
    display: block;
    height: 96.2%;
}

body[data-page="index"] .featured-book-mockup::after {
    inset: 0.36rem -0.85rem 0.5rem 0.5rem;
}

body[data-page="index"] .featured-book-tag {
    position: relative;
    z-index: 2;
    align-self: flex-start;
    width: calc(100% - 126px);
    margin: 36px 0 0 76px;
    padding: 0 0 13px;
    border-bottom: 1px solid var(--editorial-ink);
    color: var(--editorial-ink);
    font-size: 12px;
    letter-spacing: 0.08em;
    transform: translateY(1px);
}

/* Project index */
body[data-page="index"] .home-projects {
    grid-area: projects;
    min-width: 0;
    scroll-margin-top: 112px;
}

body[data-page="index"] .home-projects > .section-title h2,
body[data-page="index"] .home-others > .section-title h2 {
    color: var(--editorial-teal);
    font-family: var(--editorial-display);
    font-size: clamp(34px, 2.8vw, 44px);
    font-weight: 700;
    letter-spacing: -0.055em;
    line-height: 1;
}

body[data-page="index"] .home-projects {
    width: calc(100% + 132px);
}

body[data-page="index"] .grid-projects,
body[data-page="index"] .home-others-list {
    display: block;
    margin-top: 16px;
    border-top: 1px solid var(--editorial-line);
}

body[data-page="index"] .editorial-project {
    display: grid;
    grid-template-columns: 101px 196px minmax(260px, 1fr) 58px 24px;
    gap: 16px;
    align-items: center;
    min-height: 64px;
    max-width: none;
    padding: 8px 8px 8px 0;
    border: 0;
    border-bottom: 1px solid var(--editorial-line);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: var(--editorial-ink);
    transition: background 0.18s ease, padding 0.18s ease;
}

body[data-page="index"] .editorial-project:hover {
    padding-right: 14px;
    padding-left: 8px;
    border-color: var(--editorial-line);
    background: rgba(55, 203, 189, 0.08);
    box-shadow: none;
    transform: none;
}

body[data-page="index"] .project-index {
    color: var(--editorial-teal);
    font-family: var(--editorial-display);
    font-size: 35px;
    font-weight: 700;
    letter-spacing: -0.06em;
    line-height: 1;
}

body[data-page="index"] .editorial-project h3,
body[data-page="index"] .mini-card h3 {
    margin: 0;
    padding: 0;
    color: var(--editorial-ink);
    font-family: var(--editorial-display);
    font-size: clamp(19px, 1.4vw, 22px);
    letter-spacing: -0.035em;
    line-height: 1.1;
}

body[data-page="index"] .editorial-project p,
body[data-page="index"] .mini-card p {
    margin: 0;
    color: var(--editorial-ink);
    font-size: 11px;
    line-height: 1.4;
}

body[data-page="index"] .editorial-project .card-type {
    position: static;
    display: inline-flex;
    justify-self: start;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--editorial-ink);
    font-family: var(--editorial-display);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

body[data-page="index"] .editorial-project .card-type svg {
    display: none;
}

body[data-page="index"] .project-arrow {
    justify-self: end;
    font-size: 21px;
    transition: transform 0.18s ease;
}

body[data-page="index"] .home-others {
    grid-area: others;
    margin: -28px 0 0;
}

body[data-page="index"] .home-others > .section-title h2 {
    font-size: 18px;
    letter-spacing: -0.025em;
}

body[data-page="index"] .mini-card {
    width: 100%;
}

/* Editorial quote */
body[data-page="index"] .home-quote {
    grid-area: quote;
    align-self: stretch;
    margin-left: 164px;
    padding: 28px 0 8px 30px;
    border-left: 1px solid rgba(8, 36, 83, 0.45);
}

body[data-page="index"] .home-quote-mark {
    display: block;
    height: 34px;
    color: var(--editorial-teal);
    font-family: Georgia, serif;
    font-size: 64px;
    line-height: 0.9;
}

body[data-page="index"] .home-quote blockquote {
    max-width: 430px;
    margin: 10px 0 20px;
    color: var(--editorial-ink);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 21px;
    font-style: italic;
    line-height: 1.25;
}

body[data-page="index"] .home-quote-rule {
    display: block;
    width: 60px;
    height: 3px;
    background: var(--editorial-gold);
}

/* Footer */
body[data-page="index"] footer {
    position: fixed;
    z-index: 8;
    right: auto;
    bottom: 0;
    left: 50%;
    width: calc(100% - 96px);
    max-width: 1396px;
    height: var(--home-footer-height);
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--editorial-ink);
    background: rgba(245, 240, 230, 0.94);
    color: var(--editorial-ink-soft);
    text-align: left;
    transform: translateX(-50%);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}

body[data-page="index"] .footer-content {
    display: grid;
    grid-template-columns: minmax(390px, 1fr) auto minmax(390px, 1fr);
    gap: 26px;
    align-items: center;
    width: 100%;
    height: 100%;
    max-width: none;
    margin: 0;
}

body[data-page="index"] .footer-copyright {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    align-items: center;
    gap: 18px;
    width: auto;
    padding: 0;
    color: var(--editorial-ink-soft);
    font-size: 10px;
}

body[data-page="index"] .footer-copyright p {
    margin: 0;
}

body[data-page="index"] .footer-brand-mark {
    display: inline-flex;
    width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    color: var(--editorial-ink);
    text-decoration: none;
}

body[data-page="index"] .footer-brand-mark svg {
    width: 28px;
    height: 28px;
}

body[data-page="index"] .footer-brand-mark img {
    display: block;
    width: 28px;
    height: 28px;
}

body[data-page="index"] .footer-utilities {
    grid-column: 2;
    grid-row: 1;
    flex-wrap: nowrap;
    gap: 16px;
}

body[data-page="index"] .footer-social {
    gap: 16px;
}

body[data-page="index"] footer .social-link {
    width: 32px;
    height: 32px;
    padding: 5px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--editorial-ink);
}

body[data-page="index"] footer .social-link svg {
    width: 20px;
    height: 20px;
}

body[data-page="index"] footer .social-link::before {
    display: none;
}

body[data-page="index"] footer .social-link:hover,
body[data-page="index"] .footer-locale-trigger[aria-expanded="true"] {
    border-color: transparent !important;
    background: transparent;
    box-shadow: none !important;
    color: var(--editorial-teal);
    transform: translateY(-2px);
}

body[data-page="index"] .footer-social > a:first-child,
body[data-page="index"] #searchToggleFooter {
    display: none;
}

body[data-page="index"] .footer-social a[href*="github.com"] {
    order: 1;
}

body[data-page="index"] .footer-social a[href*="linkedin.com"] {
    order: 2;
}

body[data-page="index"] #openEmailFooter {
    order: 3;
}

body[data-page="index"] .footer-legal-notice {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    margin: 0;
    color: var(--editorial-ink-soft);
    font-size: 12px;
    white-space: nowrap;
}

body[data-page="index"] .footer-legal-notice a,
body[data-page="index"] .privacy-preferences {
    color: var(--editorial-ink-soft);
    font-size: inherit !important;
    font-weight: 600;
    text-decoration: none;
}

body[data-page="index"] .footer-legal-notice a:hover,
body[data-page="index"] .footer-legal-notice a:focus-visible,
body[data-page="index"] .privacy-preferences:hover,
body[data-page="index"] .privacy-preferences:focus-visible {
    color: var(--editorial-teal);
}

body[data-page="index"] .footer-locale-menu {
    border-color: rgba(8, 36, 83, 0.16);
    background: rgba(245, 240, 230, 0.98);
    box-shadow: 0 18px 44px rgba(8, 36, 83, 0.16);
}

body[data-page="index"] .footer-locale-link {
    color: var(--editorial-ink-soft);
}

body[data-page="index"] .footer-locale-link:hover,
body[data-page="index"] .footer-locale-link.active {
    background: rgba(11, 155, 151, 0.1);
    color: var(--editorial-ink);
}

body[data-page="index"] .footer-locale-option-code {
    color: var(--editorial-ink-soft);
}

/* Search, contact and privacy surfaces in the light home skin */
body[data-page="index"] .search-container {
    border-bottom: 1px solid rgba(8, 36, 83, 0.18);
    background: rgba(245, 240, 230, 0.97);
    box-shadow: 0 18px 40px rgba(8, 36, 83, 0.1);
}

body[data-page="index"] .search-box input,
body[data-page="index"] .form-group input,
body[data-page="index"] .form-group select,
body[data-page="index"] .form-group textarea {
    border-color: rgba(8, 36, 83, 0.2);
    background: rgba(255, 255, 255, 0.42);
    color: var(--editorial-ink);
}

body[data-page="index"] .search-box input::placeholder,
body[data-page="index"] .form-group input::placeholder,
body[data-page="index"] .form-group textarea::placeholder {
    color: rgba(8, 36, 83, 0.48);
}

body[data-page="index"] .search-result-item,
body[data-page="index"] .search-result-title,
body[data-page="index"] .search-result-desc,
body[data-page="index"] .search-result-empty {
    color: var(--editorial-ink);
}

body[data-page="index"] .search-result-item:hover {
    background: rgba(11, 155, 151, 0.08);
}

body[data-page="index"] .modal-panel-improved {
    border: 1px solid rgba(8, 36, 83, 0.18);
    background: var(--editorial-paper);
    box-shadow: 0 26px 80px rgba(8, 36, 83, 0.22);
    color: var(--editorial-ink);
}

body[data-page="index"] .modal-header,
body[data-page="index"] .form-group label,
body[data-page="index"] .modal-close {
    color: var(--editorial-ink);
}

body[data-page="index"] .privacy-chip {
    bottom: calc(var(--home-footer-height) + 14px);
    border-color: rgba(8, 36, 83, 0.24);
    background: rgba(245, 240, 230, 0.96);
    box-shadow: 0 12px 30px rgba(8, 36, 83, 0.14);
    color: var(--editorial-teal);
}

body[data-page="index"] .privacy-panel {
    bottom: calc(var(--home-footer-height) + 14px);
    max-height: calc(100dvh - var(--home-header-height) - var(--home-footer-height) - 28px);
    border-color: rgba(8, 36, 83, 0.2);
    background:
        linear-gradient(145deg, rgba(245, 240, 230, 0.99), rgba(236, 227, 213, 0.99)),
        radial-gradient(circle at 0 0, rgba(55, 203, 189, 0.12), transparent 45%);
    box-shadow: 0 24px 76px rgba(8, 36, 83, 0.24);
    color: var(--editorial-ink);
}

body[data-page="index"] .privacy-panel-close,
body[data-page="index"] .privacy-panel-copy p,
body[data-page="index"] .privacy-panel-status {
    color: var(--editorial-ink-soft);
}

body[data-page="index"] .privacy-panel-copy a {
    color: var(--editorial-teal);
}

body[data-page="index"] .privacy-action--neutral,
body[data-page="index"] .privacy-action--secondary {
    border-color: rgba(8, 36, 83, 0.26);
    background: transparent;
    color: var(--editorial-ink);
}

body[data-page="index"] .privacy-action--primary {
    background: linear-gradient(105deg, var(--editorial-turquoise), #2eb5b4);
    color: var(--editorial-ink);
}

/* Tablet */
@media (max-width: 1240px) {
    body[data-page="index"] nav.topnav a {
        min-width: 112px;
        padding: 0 16px;
    }

    body[data-page="index"] nav.topnav .home-guide-link {
        min-width: 174px;
    }

    body[data-page="index"] nav.topnav a:nth-child(3) {
        min-width: 132px;
    }

    body[data-page="index"] .home-layout {
        grid-template-columns: 1fr;
        grid-template-areas:
            "about"
            "featured"
            "projects"
            "quote";
    }

    body[data-page="index"] .home-primary,
    body[data-page="index"] .home-secondary {
        display: contents;
    }

    body[data-page="index"] .home-projects {
        width: auto;
    }

    body[data-page="index"] .home-about {
        grid-template-columns: minmax(360px, 1.2fr) minmax(260px, 0.8fr);
    }

    body[data-page="index"] .home-featured,
    body[data-page="index"] .home-quote {
        margin-left: 0;
        padding-left: 0;
        border-left: 0;
    }

    body[data-page="index"] .featured-book {
        grid-template-columns: minmax(260px, 0.72fr) minmax(340px, 1.28fr);
        padding-top: 34px;
        border-top: 1px solid var(--editorial-line);
    }

    body[data-page="index"] .featured-book-stage {
        max-width: 540px;
        margin-right: 0;
        margin-left: 0;
        justify-self: end;
    }

    body[data-page="index"] .featured-book-mockup {
        transform: perspective(1000px) rotateY(-5deg);
    }

    body[data-page="index"] .featured-book-cover-link:hover .featured-book-mockup {
        transform: perspective(1000px) rotateY(-2deg) translateY(-5px);
    }

    body[data-page="index"] .home-quote {
        max-width: 640px;
    }
}

@media (min-width: 1241px) and (max-height: 950px) {
    body[data-page="index"] .home-secondary {
        gap: 0;
    }

    body[data-page="index"] .home-quote {
        padding-top: 12px;
        padding-bottom: 4px;
    }

    body[data-page="index"] .home-quote blockquote {
        margin-top: 4px;
        margin-bottom: 6px;
    }
}

/* Mobile navigation and layout */
@media (max-width: 820px) {
    body[data-page="index"] {
        --home-header-height: 72px;
        --home-footer-height: 0px;
        height: auto;
        min-height: 100dvh;
        overflow-x: hidden;
        overflow-y: auto;
        padding-top: 0;
    }

    body[data-page="index"].mobile-nav-open {
        overflow: hidden;
    }

    body[data-page="index"] .topbar .inner {
        min-height: var(--home-header-height);
        padding: 0 12px;
    }

    body[data-page="index"] .brand {
        min-width: 0;
        flex: 1 1 auto;
        gap: 10px;
    }

    body[data-page="index"] .brand > a:first-child {
        flex: 0 0 auto;
    }

    body[data-page="index"] .brand-text-group {
        min-width: 0;
    }

    body[data-page="index"] .brand-monogram {
        width: 38px;
        height: 38px;
    }

    body[data-page="index"] .brand-text-group h1 {
        overflow: hidden;
        font-size: clamp(13px, 3.8vw, 16px);
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body[data-page="index"] .brand-text-group > span {
        display: flex;
        align-items: center;
        overflow: hidden;
        font-size: clamp(9px, 2.55vw, 11px);
        line-height: 1.2;
        white-space: nowrap;
    }

    body[data-page="index"] .search-btn {
        display: inline-flex;
        width: 40px;
        height: 40px;
        flex: 0 0 40px;
        border: 1px solid rgba(8, 36, 83, 0.2);
        border-radius: 50%;
        background: transparent;
        color: var(--editorial-ink);
        box-shadow: none;
    }

    body[data-page="index"] .search-btn svg {
        width: 19px;
        height: 19px;
    }

    body[data-page="index"] .topbar-actions {
        flex: 0 0 auto;
        gap: 6px;
    }

    body[data-page="index"] .hambtn {
        display: inline-flex;
        width: 40px;
        height: 40px;
        align-items: center;
        justify-content: center;
        border: 1px solid rgba(8, 36, 83, 0.2);
        border-radius: 50%;
        color: var(--editorial-ink);
        font-size: 20px !important;
    }

    body[data-page="index"] .hambtn[aria-expanded="true"] {
        background: rgba(11, 155, 151, 0.08);
        transform: none;
    }

    body[data-page="index"] .hambtn[aria-expanded="true"] span {
        font-size: 0;
    }

    body[data-page="index"] .hambtn[aria-expanded="true"] span::before {
        font-size: 26px;
        font-weight: 300;
        line-height: 1;
        content: '×';
    }

    body[data-page="index"] #mobile-nav {
        top: var(--home-header-height);
        max-height: calc(100dvh - var(--home-header-height));
        overflow-y: auto;
        padding: 10px 16px 18px;
        border: 0;
        border-bottom: 2px solid var(--editorial-ink);
        border-radius: 0;
        background: rgba(245, 240, 230, 0.98);
        box-shadow: 0 16px 34px rgba(8, 36, 83, 0.12);
    }

    body[data-page="index"] #mobile-nav a {
        display: grid;
        grid-template-columns: 38px minmax(0, 1fr) 22px;
        gap: 10px;
        align-items: center;
        margin: 0;
        padding: 11px 2px;
        border-bottom: 1px solid rgba(8, 36, 83, 0.14);
        border-radius: 0;
        color: var(--editorial-ink);
        font-size: 14px;
        font-weight: 700;
    }

    body[data-page="index"] #mobile-nav .mobile-nav-number {
        color: var(--editorial-teal);
        font-family: var(--editorial-display);
        font-size: 18px;
        font-weight: 800;
        letter-spacing: -0.04em;
    }

    body[data-page="index"] #mobile-nav .mobile-nav-arrow {
        justify-self: end;
        font-size: 17px;
    }

    body[data-page="index"] #mobile-nav .mobile-nav-featured {
        border-bottom-color: var(--editorial-gold);
        background: linear-gradient(90deg, rgba(55, 203, 189, 0.14), transparent);
    }

    body[data-page="index"] #mobile-nav a:hover {
        background: transparent;
        color: var(--editorial-teal);
    }

    body[data-page="index"] .wrap {
        height: auto;
        min-height: calc(100dvh - var(--home-header-height));
        margin-top: var(--home-header-height);
        overflow: visible;
        overscroll-behavior: auto;
        padding: 24px 20px 28px;
    }

    body[data-page="index"] .home-layout {
        row-gap: 30px;
    }

    body[data-page="index"] .home-about {
        grid-template-columns: clamp(132px, 39vw, 148px) minmax(0, 1fr);
        grid-template-areas:
            "avatar identity"
            "about-title about-title"
            "bio bio";
        gap: 18px clamp(10px, 4vw, 18px);
        align-items: center;
        padding-top: 0;
    }

    body[data-page="index"] .home-identity {
        display: contents;
    }

    body[data-page="index"] .home-name {
        grid-area: identity;
        align-self: center;
        font-size: clamp(40px, 10.5vw, 50px);
        line-height: 0.9;
    }

    body[data-page="index"] .home-role {
        display: none;
    }

    body[data-page="index"] .profile-card {
        display: contents;
    }

    body[data-page="index"] .profile-avatar-container {
        grid-area: avatar;
        width: clamp(132px, 39vw, 148px);
        height: clamp(88px, 26vw, 98px);
        align-self: center;
        justify-self: start;
    }

    body[data-page="index"] .author-portrait {
        width: clamp(82px, 24vw, 94px);
        height: clamp(82px, 24vw, 94px);
        border-width: 2px;
        box-shadow:
            0 0 0 2px var(--editorial-paper),
            0 7px 16px rgba(8, 36, 83, 0.14);
    }

    body[data-page="index"] .author-portrait-link {
        width: clamp(28px, 8vw, 34px);
        height: clamp(28px, 8vw, 34px);
        border-width: 2px;
    }

    body[data-page="index"] .author-portrait-link svg {
        width: clamp(16px, 4.8vw, 19px);
        height: clamp(16px, 4.8vw, 19px);
    }

    body[data-page="index"] .profile-info {
        display: contents;
    }

    body[data-page="index"] .profile-info .section-title {
        grid-area: about-title;
        width: 100%;
        margin: 0;
    }

    body[data-page="index"] .profile-info .section-title h2 {
        display: flex;
        align-items: center;
        gap: 12px;
        font-size: 13px;
        letter-spacing: 0.06em;
        text-transform: uppercase;
    }

    body[data-page="index"] .profile-info .section-title h2::after {
        height: 1px;
        flex: 1;
        background: rgba(8, 36, 83, 0.3);
        content: '';
    }

    body[data-page="index"] .profile-bio {
        grid-area: bio;
        grid-column: 1 / -1;
        width: 100%;
        max-width: none;
    }

    body[data-page="index"] .profile-info .lead {
        width: 100%;
        max-width: none;
        margin-bottom: 10px;
        font-size: 12.5px;
        line-height: 1.48;
    }

    body[data-page="index"] .featured-book {
        grid-template-columns: minmax(124px, 0.88fr) minmax(0, 1.12fr);
        grid-template-areas: "stage copy-panel";
        gap: 0 clamp(14px, 4vw, 22px);
        align-items: start;
        padding-top: 20px;
    }

    body[data-page="index"] .featured-book-stage {
        grid-area: stage;
        width: 100%;
        min-height: 0;
        margin: 0;
        padding: 8px 4px 0 0;
        justify-self: stretch;
    }

    body[data-page="index"] .featured-book-mockup {
        max-width: clamp(132px, 38vw, 178px);
        margin: 0 auto;
        transform: perspective(900px) rotateY(-4deg);
    }

    body[data-page="index"] .featured-book-cover-link:hover .featured-book-mockup {
        transform: perspective(900px) rotateY(-2deg) translateY(-3px);
    }

    body[data-page="index"] .featured-book-stage::after {
        display: none;
    }

    body[data-page="index"] .featured-book-tag {
        display: none;
    }

    body[data-page="index"] .featured-book-body {
        display: contents;
    }

    body[data-page="index"] [data-featured-book-copy] {
        grid-area: copy-panel;
        align-self: start;
    }

    body[data-page="index"] .home-featured .section-title {
        margin: 2px 0 10px;
    }

    body[data-page="index"] .home-featured .section-title h2 {
        font-size: 11px;
    }

    body[data-page="index"] [data-featured-heading-desktop] {
        display: none;
    }

    body[data-page="index"] [data-featured-heading-mobile] {
        display: inline;
    }

    body[data-page="index"] .featured-book-title,
    body[data-page="index"] .featured-book h3 {
        font-size: clamp(32px, 9.4vw, 43px);
        line-height: 0.9;
    }

    body[data-page="index"] .featured-title-rule {
        width: 42px;
        margin: 12px 0 14px;
    }

    body[data-page="index"] .featured-book p {
        margin: 0;
        font-size: 11.5px;
        line-height: 1.45;
    }

    body[data-page="index"] .featured-book-actions {
        grid-area: auto;
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
        margin-top: 16px;
    }

    body[data-page="index"] .featured-book-cta {
        grid-template-columns: 32px minmax(0, 1fr) auto;
        min-height: 44px;
        gap: 7px;
        font-size: 11.5px;
    }

    body[data-page="index"] .featured-cta-icon {
        width: 30px;
        height: 30px;
    }

    body[data-page="index"] .editorial-project {
        grid-template-columns: 42px minmax(0, 1fr) auto 18px;
        grid-template-rows: auto auto;
        gap: 6px 10px;
        min-height: 0;
        padding: 14px 2px 15px 0;
        /* `.card` belongs to the legacy glass theme. Chromium promotes its
           backdrop blur to a mobile compositing layer and paints a dark band
           when a project row crosses the viewport edge. */
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }

    body[data-page="index"] .editorial-project p {
        grid-column: 2 / -1;
        grid-row: 2;
        padding-right: 8px;
        font-size: 12px;
        line-height: 1.45;
    }

    body[data-page="index"] .project-index {
        grid-row: 1 / span 2;
        align-self: start;
        font-size: 26px;
    }

    body[data-page="index"] .editorial-project h3 {
        grid-column: 2;
        grid-row: 1;
        min-width: 0;
        overflow-wrap: anywhere;
        font-size: 20px;
    }

    body[data-page="index"] .editorial-project .card-type {
        grid-column: 3;
        grid-row: 1;
    }

    body[data-page="index"] .project-arrow {
        grid-column: 4;
        grid-row: 1;
    }

    body[data-page="index"] .home-others {
        margin-top: -18px;
    }

    body[data-page="index"] .home-quote {
        padding: 4px 0 8px 18px;
        border-left: 1px solid rgba(8, 36, 83, 0.3);
    }

    body[data-page="index"] .home-quote blockquote {
        margin: 6px 0 14px;
        font-size: clamp(20px, 6.5vw, 27px);
    }

    body[data-page="index"] footer {
        position: relative;
        right: auto;
        bottom: auto;
        left: auto;
        width: 100%;
        max-width: none;
        height: auto;
        margin: 0;
        padding: 26px 16px calc(64px + env(safe-area-inset-bottom));
        background: rgba(245, 240, 230, 0.97);
        text-align: center;
        transform: none;
    }

    body[data-page="index"] .footer-content {
        display: flex;
        height: auto;
        max-width: 640px;
        flex-direction: column;
        gap: 14px;
        align-items: center;
        text-align: center;
    }

    body[data-page="index"] .footer-copyright {
        order: 3;
        justify-content: center;
        gap: 8px;
    }

    body[data-page="index"] .footer-copyright p {
        display: block;
        margin: 0;
        font-size: 10px;
        line-height: 1.35;
        white-space: normal;
    }

    body[data-page="index"] .footer-brand-mark,
    body[data-page="index"] .footer-brand-mark img {
        width: 24px;
        height: 24px;
    }

    body[data-page="index"] .footer-legal-notice {
        order: 2;
        justify-self: auto;
        font-size: 12px;
        line-height: 1.5;
        white-space: normal;
    }

    body[data-page="index"] .footer-utilities {
        order: 1;
        justify-self: auto;
        flex-wrap: nowrap;
        gap: 7px;
    }

    body[data-page="index"] .footer-social {
        flex-wrap: nowrap;
        gap: 7px;
    }

    body[data-page="index"] footer .social-link {
        width: 36px;
        height: 36px;
        padding: 7px;
        border: 1px solid rgba(8, 36, 83, 0.18);
        border-radius: 50%;
    }

    body[data-page="index"] footer .social-link svg {
        width: 19px;
        height: 19px;
    }

    body[data-page="index"] .footer-social > a:first-child,
    body[data-page="index"] #searchToggleFooter {
        display: inline-flex;
    }

    body[data-page="index"] .footer-locale {
        display: block;
    }

    body[data-page="index"] .privacy-chip {
        right: 14px;
        bottom: max(14px, env(safe-area-inset-bottom));
        width: 42px;
        height: 42px;
    }

    body[data-page="index"] .privacy-panel {
        bottom: max(14px, env(safe-area-inset-bottom));
        max-height: calc(100dvh - var(--home-header-height) - 28px);
    }
}

@media (max-width: 480px) {
    body[data-page="index"] .topbar .inner {
        padding: 0 10px;
    }

    body[data-page="index"] .brand {
        gap: 7px;
    }

    body[data-page="index"] .brand-monogram {
        width: 34px;
        height: 34px;
    }

    body[data-page="index"] .brand-text-group h1 {
        font-size: clamp(12px, 3.7vw, 15px);
    }

    body[data-page="index"] .brand-text-group span {
        display: flex;
        font-size: clamp(8.5px, 2.5vw, 10px);
    }

    body[data-page="index"] .topbar-actions {
        gap: 4px;
    }

    body[data-page="index"] .search-btn,
    body[data-page="index"] .hambtn {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
    }

    body[data-page="index"] .wrap {
        padding-right: 16px;
        padding-left: 16px;
    }

    body[data-page="index"] .home-name {
        font-size: clamp(40px, 10.5vw, 50px);
    }

    body[data-page="index"] .featured-book-actions {
        gap: 10px;
    }

    body[data-page="index"] .featured-book-stage {
        padding-right: 4px;
        padding-left: 0;
    }

    body[data-page="index"] .featured-book-mockup {
        max-width: clamp(124px, 38vw, 164px);
    }

    body[data-page="index"] .featured-book-title,
    body[data-page="index"] .featured-book h3 {
        font-size: clamp(30px, 9.3vw, 38px);
    }

    body[data-page="index"] .home-projects > .section-title h2 {
        font-size: 29px;
    }

    body[data-page="index"] .editorial-project {
        grid-template-columns: 40px minmax(0, 1fr) auto 18px;
        column-gap: 8px;
    }

    body[data-page="index"] .editorial-project h3 {
        font-size: 18px;
    }

    body[data-page="index"] .project-index {
        font-size: 24px;
    }

    body[data-page="index"] .editorial-project .card-type {
        font-size: 9px;
    }

    body[data-page="index"] .footer-utilities,
    body[data-page="index"] .footer-social {
        flex-wrap: nowrap;
    }

    body[data-page="index"] .privacy-panel {
        right: 12px;
        bottom: max(12px, env(safe-area-inset-bottom));
        left: 12px;
        width: calc(100% - 24px);
    }
}

@media (prefers-reduced-motion: reduce) {
    body[data-page="index"] .author-portrait,
    body[data-page="index"] .author-portrait-link,
    body[data-page="index"] .featured-book-mockup,
    body[data-page="index"] .featured-cta-arrow,
    body[data-page="index"] .project-arrow {
        transition: none;
    }
}
