/*
 * Tennis Physics Hub
 * All page-specific selectors use the tphys- prefix so this file can load
 * after the existing TWU styles without changing other pages.
 */

:root {
    --tphys-navy: #062f53;
    --tphys-navy-dark: #031f38;
    --tphys-blue: #0a5f96;
    --tphys-sky: #dceefa;
    --tphys-gold: #f3b61f;
    --tphys-ink: #17242f;
    --tphys-muted: #536473;
    --tphys-line: #d8e0e6;
    --tphys-paper: #ffffff;
    --tphys-soft: #f4f7f9;
    --tphys-shadow: 0 18px 45px rgba(6, 47, 83, 0.12);
    --tphys-radius: 18px;

    /*
     * Shared vertical spacing controls.
     * Adjust these four values to tighten or loosen every major page section.
     */
    --tphys-section-space: clamp(2.25rem, 4vw, 3.75rem);
    --tphys-section-space-compact: clamp(2rem, 3.5vw, 3.25rem);
    --tphys-hero-space: clamp(2.5rem, 4.5vw, 4.25rem);
    --tphys-hero-min-height: 620px;
}

.tphys-page,
.tphys-page * {
    box-sizing: border-box;
}

.tphys-page {
    width: 100%;
    max-width: none;
    margin: 0;
    color: var(--tphys-ink);
    background: var(--tphys-paper);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.62;
}

.tphys-page img {
    display: block;
    max-width: 100%;
    height: auto;
}

.tphys-page a {
    color: var(--tphys-blue);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.tphys-page a:hover,
.tphys-page a:focus {
    color: var(--tphys-navy-dark);
}

.tphys-page h1,
.tphys-page h2,
.tphys-page h3,
.tphys-page p,
.tphys-page ul,
.tphys-page ol,
.tphys-page figure {
    margin-top: 0;
}

.tphys-page h1,
.tphys-page h2,
.tphys-page h3 {
    color: var(--tphys-navy);
    line-height: 1.15;
}

.tphys-page h1 {
    max-width: 780px;
    margin-bottom: 0.35em;
    font-size: clamp(2.6rem, 6vw, 5.8rem);
    letter-spacing: -0.045em;
}

.tphys-page h2 {
    margin-bottom: 0.45em;
    font-size: clamp(2rem, 4vw, 3.45rem);
    letter-spacing: -0.025em;
}

.tphys-page h3 {
    margin-bottom: 0.55em;
    font-size: clamp(1.2rem, 2vw, 1.55rem);
}

.tphys-eyebrow,
.tphys-kicker,
.tphys-topic-card__label {
    margin-bottom: 0.7rem;
    color: var(--tphys-blue);
    font-size: 0.77rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.tphys-section-heading {
    max-width: 820px;
    margin-bottom: 2.3rem;
}

.tphys-section-heading > p:last-child {
    color: var(--tphys-muted);
    font-size: 1.08rem;
}

.tphys-section-heading--center {
    margin-right: auto;
    margin-left: auto;
    text-align: center;
}

.tphys-section-heading--light h2,
.tphys-section-heading--light .tphys-kicker {
    color: #ffffff;
}

.tphys-section-heading--light > p:last-child {
    color: rgba(255, 255, 255, 0.82);
}

.tphys-hero,
.tphys-method,
.tphys-overview,
.tphys-topics,
.tphys-featured,
.tphys-audience,
.tphys-faq {
    padding-right: clamp(1.15rem, 5vw, 5.5rem);
    padding-left: clamp(1.15rem, 5vw, 5.5rem);
}

.tphys-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.88fr);
    gap: clamp(2rem, 5vw, 5rem);
    align-items: center;
    min-height: var(--tphys-hero-min-height);
    padding-top: clamp(3.5rem, 8vw, 7.5rem);
    padding-bottom: clamp(3.5rem, 8vw, 7.5rem);
    overflow: hidden;
    background:
        radial-gradient(circle at 88% 18%, rgba(243, 182, 31, 0.22), transparent 22%),
        linear-gradient(135deg, #f8fbfd 0%, #eaf4fa 54%, #d8ebf6 100%);
}

.tphys-hero::before {
    content: "";
    position: absolute;
    top: -110px;
    right: -100px;
    width: 430px;
    height: 430px;
    border: 1px solid rgba(6, 47, 83, 0.13);
    border-radius: 50%;
}

.tphys-hero__copy,
.tphys-hero__visual {
    position: relative;
    z-index: 1;
}

.tphys-hero__lead {
    max-width: 770px;
    margin-bottom: 1.15rem;
    color: var(--tphys-navy);
    font-size: clamp(1.25rem, 2.2vw, 1.75rem);
    font-weight: 700;
    line-height: 1.35;
}

.tphys-hero__intro {
    max-width: 780px;
    color: var(--tphys-muted);
    font-size: 1.06rem;
}

.tphys-button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1.7rem;
}

.tphys-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0.78rem 1.2rem;
    border: 2px solid transparent;
    border-radius: 999px;
    font-size: 0.94rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.tphys-button:hover,
.tphys-button:focus {
    transform: translateY(-2px);
}

.tphys-button--primary {
    color: #ffffff !important;
    background: var(--tphys-navy);
    box-shadow: 0 8px 22px rgba(6, 47, 83, 0.18);
}

.tphys-button--primary:hover,
.tphys-button--primary:focus {
    background: var(--tphys-blue);
}

.tphys-button--secondary {
    color: var(--tphys-navy) !important;
    border-color: rgba(6, 47, 83, 0.35);
    background: rgba(255, 255, 255, 0.56);
}

.tphys-button--secondary:hover,
.tphys-button--secondary:focus {
    background: #ffffff;
}

.tphys-button--secondary-light {
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.58);
    background: transparent;
}

.tphys-button--secondary-light:hover,
.tphys-button--secondary-light:focus {
    color: var(--tphys-navy) !important;
    background: #ffffff;
}

.tphys-button--outline {
    color: var(--tphys-navy) !important;
    border-color: var(--tphys-navy);
    background: #ffffff;
}

.tphys-hero__visual {
    margin: 0;
}

.tphys-hero__image-frame {
    position: relative;
    padding: clamp(0.7rem, 2vw, 1.1rem);
    border-radius: 50% 50% 48% 52% / 46% 48% 52% 54%;
    background: rgba(255, 255, 255, 0.74);
    box-shadow: var(--tphys-shadow);
}

.tphys-hero__image-frame img {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: inherit;
    object-fit: cover;
}

.tphys-hero__visual figcaption {
    margin-top: 0.85rem;
    color: var(--tphys-muted);
    font-size: 0.82rem;
    text-align: center;
}

.tphys-orbit {
    position: absolute;
    border: 2px solid rgba(10, 95, 150, 0.26);
    border-radius: 50%;
    pointer-events: none;
}

.tphys-orbit--one {
    inset: -7% 8% 10% -7%;
    transform: rotate(17deg);
}

.tphys-orbit--two {
    inset: 4% -8% -5% 12%;
    border-color: rgba(243, 182, 31, 0.48);
    transform: rotate(-18deg);
}

.tphys-method {
    padding-top: clamp(4rem, 8vw, 7rem);
    padding-bottom: clamp(4rem, 8vw, 7rem);
    background: #ffffff;
}

.tphys-method__steps {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.7rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0;
    list-style: none;
}

.tphys-method__steps li {
    position: relative;
    min-height: 180px;
    padding: 1.15rem 0.9rem;
    border: 1px solid var(--tphys-line);
    border-radius: 14px;
    background: var(--tphys-soft);
    text-align: center;
}

.tphys-method__steps li:not(:last-child)::after {
    content: "→";
    position: absolute;
    top: 50%;
    right: -0.75rem;
    z-index: 2;
    width: 1.45rem;
    color: var(--tphys-gold);
    font-size: 1.35rem;
    font-weight: 700;
    transform: translateY(-50%);
}

.tphys-method__steps strong,
.tphys-method__steps small {
    display: block;
}

.tphys-method__steps strong {
    margin: 0.6rem 0 0.35rem;
    color: var(--tphys-navy);
    font-size: 1rem;
}

.tphys-method__steps small {
    color: var(--tphys-muted);
    font-size: 0.8rem;
    line-height: 1.45;
}

.tphys-step-number {
    display: inline-grid;
    width: 2.2rem;
    height: 2.2rem;
    place-items: center;
    border-radius: 50%;
    color: #ffffff;
    background: var(--tphys-blue);
    font-weight: 700;
}

.tphys-method__summary {
    margin: 2rem 0 0;
    color: var(--tphys-navy);
    text-align: center;
}

.tphys-overview {
    padding-top: clamp(4rem, 8vw, 7rem);
    padding-bottom: clamp(4rem, 8vw, 7rem);
    background: var(--tphys-soft);
}

.tphys-overview__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
    gap: clamp(2rem, 6vw, 6rem);
    align-items: start;
}

.tphys-prose {
    max-width: 780px;
    font-size: 1.1rem;
}

.tphys-question-list {
    margin: 0;
    padding: 1.5rem 1.5rem 1.5rem 3.1rem;
    border-left: 6px solid var(--tphys-gold);
    border-radius: 0 var(--tphys-radius) var(--tphys-radius) 0;
    background: #ffffff;
    box-shadow: var(--tphys-shadow);
}

.tphys-question-list li + li {
    margin-top: 0.55rem;
}

.tphys-topics {
    padding-top: clamp(4rem, 8vw, 7rem);
    padding-bottom: clamp(4rem, 8vw, 7rem);
}

.tphys-topic-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(1.3rem, 3vw, 2.2rem);
    max-width: 1450px;
    margin: 0 auto;
}

.tphys-topic-card {
    display: grid;
    grid-template-columns: minmax(180px, 0.72fr) minmax(0, 1.28fr);
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--tphys-line);
    border-radius: var(--tphys-radius);
    background: #ffffff;
    box-shadow: 0 12px 30px rgba(6, 47, 83, 0.08);
}

.tphys-topic-card--wide {
    grid-column: 1 / -1;
    grid-template-columns: minmax(260px, 0.55fr) minmax(0, 1.45fr);
}

.tphys-topic-card__image {
    min-height: 100%;
    overflow: hidden;
    background: var(--tphys-sky);
}

.tphys-topic-card__image img {
    width: 100%;
    height: 100%;
    min-height: 300px;
    object-fit: cover;
    transition: transform 320ms ease;
}

.tphys-topic-card:hover .tphys-topic-card__image img {
    transform: scale(1.035);
}

.tphys-topic-card__body {
    padding: clamp(1.25rem, 3vw, 2rem);
}

.tphys-topic-card__body > p:not(.tphys-topic-card__label) {
    color: var(--tphys-muted);
}

.tphys-topic-card h3 a {
    color: inherit;
    text-decoration: none;
}

.tphys-topic-card h3 a:hover,
.tphys-topic-card h3 a:focus {
    color: var(--tphys-blue);
}

.tphys-link-list {
    margin: 1rem 0 1.25rem;
    padding-left: 1.2rem;
    font-size: 0.9rem;
}

.tphys-link-list li + li {
    margin-top: 0.28rem;
}

.tphys-link-list--columns {
    columns: 2;
    column-gap: 2rem;
}

.tphys-text-link {
    display: inline-block;
    font-weight: 700;
    text-decoration: none;
}

.tphys-tools {
    padding: clamp(4rem, 8vw, 7rem) clamp(1.15rem, 5vw, 5.5rem);
    background:
        linear-gradient(135deg, rgba(6, 47, 83, 0.98), rgba(10, 95, 150, 0.94)),
        url("../images/teasers/ballonstringscloseup.jpg") center / cover;
}

.tphys-tool-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    max-width: 1400px;
    margin: 0 auto;
}

.tphys-tool-card {
    display: grid;
    grid-template-columns: 165px minmax(0, 1fr);
    gap: 1.25rem;
    align-items: center;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--tphys-radius);
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(6px);
}

.tphys-tool-card img {
    width: 100%;
    aspect-ratio: 1.2 / 1;
    border-radius: 12px;
    object-fit: cover;
}

.tphys-tool-card h3,
.tphys-tool-card a {
    color: #ffffff;
}

.tphys-tool-card p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.92rem;
}

.tphys-tool-card a {
    font-weight: 700;
    text-decoration: none;
}

.tphys-featured {
    padding-top: clamp(4rem, 8vw, 7rem);
    padding-bottom: clamp(4rem, 8vw, 7rem);
    background: #ffffff;
}

.tphys-feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    max-width: 1400px;
    margin: 0 auto;
}

.tphys-feature-grid article {
    padding: 1.45rem;
    border: 1px solid var(--tphys-line);
    border-radius: 14px;
    background: var(--tphys-soft);
}

.tphys-feature-grid span {
    display: inline-block;
    margin-bottom: 0.8rem;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    color: var(--tphys-navy);
    background: var(--tphys-sky);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.tphys-feature-grid h3 a {
    color: inherit;
    text-decoration: none;
}

.tphys-feature-grid p {
    margin-bottom: 0;
    color: var(--tphys-muted);
    font-size: 0.92rem;
}

.tphys-centered-link {
    margin-top: 2.2rem;
    text-align: center;
}

.tphys-audience {
    padding-top: clamp(4rem, 8vw, 7rem);
    padding-bottom: clamp(4rem, 8vw, 7rem);
    background: var(--tphys-soft);
}

.tphys-audience-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1rem;
    max-width: 1450px;
    margin: 0 auto;
}

.tphys-audience-grid article {
    padding: 1.3rem;
    border-top: 5px solid var(--tphys-gold);
    border-radius: 0 0 12px 12px;
    background: #ffffff;
    box-shadow: 0 8px 22px rgba(6, 47, 83, 0.06);
}

.tphys-audience-grid p {
    margin-bottom: 0;
    color: var(--tphys-muted);
    font-size: 0.9rem;
}

.tphys-about {
    display: grid;
    grid-template-columns: minmax(300px, 0.82fr) minmax(0, 1.18fr);
    gap: clamp(2rem, 6vw, 6rem);
    align-items: center;
    padding: clamp(4rem, 8vw, 7rem) clamp(1.15rem, 5vw, 5.5rem);
    background: #ffffff;
}

.tphys-about__image img {
    width: 100%;
    max-height: 520px;
    border-radius: var(--tphys-radius);
    object-fit: cover;
    box-shadow: var(--tphys-shadow);
}

.tphys-about__copy {
    max-width: 780px;
}

.tphys-about__copy p {
    color: var(--tphys-muted);
}

.tphys-faq {
    padding-top: clamp(4rem, 8vw, 7rem);
    padding-bottom: clamp(4rem, 8vw, 7rem);
    background: var(--tphys-soft);
}

.tphys-faq__list {
    max-width: 1000px;
}

.tphys-faq details {
    border-bottom: 1px solid var(--tphys-line);
    background: #ffffff;
}

.tphys-faq details:first-child {
    border-radius: 12px 12px 0 0;
}

.tphys-faq details:last-child {
    border-bottom: 0;
    border-radius: 0 0 12px 12px;
}

.tphys-faq summary {
    position: relative;
    padding: 1.15rem 3rem 1.15rem 1.3rem;
    color: var(--tphys-navy);
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}

.tphys-faq summary::-webkit-details-marker {
    display: none;
}

.tphys-faq summary::after {
    content: "+";
    position: absolute;
    top: 50%;
    right: 1.25rem;
    font-size: 1.45rem;
    transform: translateY(-50%);
}

.tphys-faq details[open] summary::after {
    content: "−";
}

.tphys-faq details p {
    max-width: 900px;
    margin: 0;
    padding: 0 1.3rem 1.35rem;
    color: var(--tphys-muted);
}

.tphys-closing {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.6fr);
    gap: 2rem;
    align-items: center;
    padding: clamp(3.5rem, 7vw, 6rem) clamp(1.15rem, 5vw, 5.5rem);
    color: #ffffff;
    background: linear-gradient(135deg, var(--tphys-navy-dark), var(--tphys-blue));
}

.tphys-closing h2,
.tphys-closing .tphys-kicker {
    color: #ffffff;
}

.tphys-closing p:not(.tphys-kicker) {
    max-width: 860px;
    color: rgba(255, 255, 255, 0.82);
}

.tphys-closing .tphys-button-row {
    justify-content: flex-end;
}

@media (max-width: 1180px) {
    .tphys-method__steps {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .tphys-method__steps li:not(:last-child)::after {
        display: none;
    }

    .tphys-topic-grid {
        grid-template-columns: 1fr;
    }

    .tphys-topic-card--wide {
        grid-column: auto;
    }

    .tphys-audience-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .tphys-hero,
    .tphys-overview__grid,
    .tphys-about,
    .tphys-closing {
        grid-template-columns: 1fr;
    }

    .tphys-hero {
        min-height: auto;
    }

    .tphys-hero__visual {
        max-width: 620px;
        margin: 0 auto;
    }

    .tphys-tool-grid,
    .tphys-feature-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tphys-closing .tphys-button-row {
        justify-content: flex-start;
    }
}

@media (max-width: 680px) {
    .tphys-method__steps,
    .tphys-tool-grid,
    .tphys-feature-grid,
    .tphys-audience-grid {
        grid-template-columns: 1fr;
    }

    .tphys-topic-card,
    .tphys-topic-card--wide {
        grid-template-columns: 1fr;
    }

    .tphys-topic-card__image img {
        min-height: 220px;
        max-height: 320px;
    }

    .tphys-tool-card {
        grid-template-columns: 110px minmax(0, 1fr);
    }

    .tphys-link-list--columns {
        columns: 1;
    }

    .tphys-button-row,
    .tphys-button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tphys-button,
    .tphys-topic-card__image img {
        transition: none;
    }
}

/* v2 visibility and supporting-page additions */
.tphys-tools .tphys-tool-card a,
.tphys-tools .tphys-tool-card a:visited {
    color: #ffffff !important;
    text-decoration-color: rgba(255, 255, 255, 0.72);
}

.tphys-tools .tphys-tool-card a:hover,
.tphys-tools .tphys-tool-card a:focus {
    color: var(--tphys-gold) !important;
    text-decoration-color: var(--tphys-gold);
}

.tphys-about__image {
    margin: 0;
}

.tphys-about__image figcaption {
    margin-top: 0.75rem;
    color: var(--tphys-muted);
    font-size: 0.86rem;
    line-height: 1.45;
    text-align: center;
}

/* Shared inner-page layout for About and the science directory. */
.tphys-inner-hero {
    position: relative;
    padding: clamp(3.75rem, 8vw, 7rem) clamp(1.15rem, 5vw, 5.5rem);
    overflow: hidden;
    background:
        radial-gradient(circle at 87% 12%, rgba(243, 182, 31, 0.25), transparent 24%),
        linear-gradient(135deg, #f8fbfd 0%, #e9f3f9 55%, #d7eaf6 100%);
}

.tphys-inner-hero::after {
    content: "";
    position: absolute;
    right: -120px;
    bottom: -185px;
    width: 430px;
    height: 430px;
    border: 1px solid rgba(6, 47, 83, 0.14);
    border-radius: 50%;
}

.tphys-inner-hero__content {
    position: relative;
    z-index: 1;
    max-width: 1050px;
}

.tphys-inner-hero h1 {
    max-width: 980px;
    font-size: clamp(2.5rem, 5.5vw, 5rem);
}

.tphys-inner-hero__lead {
    max-width: 870px;
    margin-bottom: 0;
    color: var(--tphys-muted);
    font-size: clamp(1.12rem, 2vw, 1.45rem);
    line-height: 1.5;
}

.tphys-inner-section {
    padding: clamp(3.5rem, 7vw, 6rem) clamp(1.15rem, 5vw, 5.5rem);
}

.tphys-inner-section--soft {
    background: var(--tphys-soft);
}

.tphys-inner-section--navy {
    color: #ffffff;
    background: linear-gradient(135deg, var(--tphys-navy-dark), var(--tphys-blue));
}

.tphys-inner-section--navy h2,
.tphys-inner-section--navy h3,
.tphys-inner-section--navy .tphys-kicker {
    color: #ffffff;
}

.tphys-inner-section--navy p {
    color: rgba(255, 255, 255, 0.84);
}

.tphys-about-intro {
    display: grid;
    grid-template-columns: minmax(300px, 0.82fr) minmax(0, 1.18fr);
    gap: clamp(2rem, 6vw, 6rem);
    align-items: center;
}

.tphys-about-intro figure {
    margin: 0;
}

.tphys-about-intro img {
    width: 100%;
    border-radius: var(--tphys-radius);
    box-shadow: var(--tphys-shadow);
}

.tphys-about-intro figcaption {
    margin-top: 0.75rem;
    color: var(--tphys-muted);
    font-size: 0.88rem;
    text-align: center;
}

.tphys-about-intro__copy p,
.tphys-content-column p {
    color: var(--tphys-muted);
}

.tphys-principle-grid,
.tphys-measure-grid,
.tphys-current-grid {
    display: grid;
    gap: 1rem;
    max-width: 1400px;
    margin: 0 auto;
}

.tphys-principle-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tphys-measure-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.tphys-current-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tphys-info-card {
    padding: 1.45rem;
    border: 1px solid var(--tphys-line);
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 8px 22px rgba(6, 47, 83, 0.05);
}

.tphys-info-card h3 {
    margin-bottom: 0.45rem;
}

.tphys-info-card p {
    margin-bottom: 0;
    color: var(--tphys-muted);
    font-size: 0.94rem;
}

.tphys-measure-card {
    padding: 1.25rem;
    border-top: 5px solid var(--tphys-gold);
    border-radius: 0 0 12px 12px;
    background: #ffffff;
}

.tphys-measure-card h3 {
    font-size: 1.08rem;
}

.tphys-measure-card p {
    margin-bottom: 0;
    color: var(--tphys-muted);
    font-size: 0.88rem;
}

.tphys-wide-copy {
    max-width: 980px;
}

.tphys-wide-copy p:last-child {
    margin-bottom: 0;
}

.tphys-directory-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1.65rem;
}

.tphys-directory-nav a,
.tphys-directory-nav a:visited {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 0.65rem 1rem;
    border: 1px solid rgba(6, 47, 83, 0.18);
    border-radius: 999px;
    color: var(--tphys-navy);
    background: rgba(255, 255, 255, 0.72);
    font-weight: 700;
    text-decoration: none;
}

.tphys-directory-nav a:hover,
.tphys-directory-nav a:focus {
    border-color: var(--tphys-gold);
    color: var(--tphys-navy-dark);
    background: #ffffff;
}

.tphys-directory {
    padding: 0 clamp(1.15rem, 5vw, 5.5rem) clamp(4rem, 8vw, 7rem);
    background: var(--tphys-soft);
}

.tphys-directory-section {
    max-width: 1450px;
    margin: 0 auto 1.5rem;
    padding: clamp(1.5rem, 4vw, 2.75rem);
    border: 1px solid var(--tphys-line);
    border-radius: var(--tphys-radius);
    background: #ffffff;
    box-shadow: 0 12px 30px rgba(6, 47, 83, 0.06);
    scroll-margin-top: 6rem;
}

.tphys-directory-section:last-child {
    margin-bottom: 0;
}

.tphys-directory-section__head {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.6rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--tphys-line);
}

.tphys-directory-section__head h2 {
    margin-bottom: 0;
    font-size: clamp(1.8rem, 3vw, 2.7rem);
}

.tphys-directory-section__head span {
    color: var(--tphys-blue);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.tphys-directory-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(1.5rem, 4vw, 3.5rem);
}

.tphys-directory-columns--single {
    grid-template-columns: minmax(0, 1fr);
    max-width: 900px;
}

.tphys-directory-group h3 {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 1rem;
    color: var(--tphys-navy);
}

.tphys-directory-group h3::before {
    content: "";
    width: 0.65rem;
    height: 0.65rem;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--tphys-gold);
}

.tphys-directory-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.tphys-directory-list li {
    border-top: 1px solid #e7edf1;
}

.tphys-directory-list li:first-child {
    border-top: 0;
}

.tphys-directory-list a,
.tphys-directory-list a:visited {
    display: flex;
    gap: 0.7rem;
    align-items: flex-start;
    padding: 0.68rem 0;
    color: var(--tphys-blue);
    font-weight: 700;
    line-height: 1.4;
    text-decoration: none;
}

.tphys-directory-list a::after {
    content: "→";
    margin-left: auto;
    color: var(--tphys-gold);
}

.tphys-directory-list a:hover,
.tphys-directory-list a:focus {
    color: var(--tphys-navy-dark);
    text-decoration: underline;
}

.tphys-page-note {
    max-width: 900px;
    margin: 0 auto;
    padding: 1rem 1.15rem;
    border-left: 5px solid var(--tphys-gold);
    color: var(--tphys-muted);
    background: #ffffff;
}

@media (max-width: 1000px) {
    .tphys-about-intro,
    .tphys-directory-columns {
        grid-template-columns: 1fr;
    }

    .tphys-principle-grid,
    .tphys-current-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tphys-measure-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .tphys-principle-grid,
    .tphys-current-grid,
    .tphys-measure-grid {
        grid-template-columns: 1fr;
    }

    .tphys-directory-section__head {
        display: block;
    }

    .tphys-directory-section__head span {
        display: block;
        margin-top: 0.4rem;
    }
}

/*
 * Ensure the shared desktop navigation remains above the new page layouts
 * whenever TWUresponsive2.js or tennis-physics-nav.js applies navwrapperfix.
 */
@media screen and (min-width: 721px) {
    #navwrapper.navwrapperfix {
        position: fixed !important;
        top: 0;
        right: 0;
        left: 0;
        width: 100% !important;
        z-index: 100;
    }
}

/* v9 complete racquet and string tools directory */
.tphys-tool-directory {
    padding: 0 clamp(1.15rem, 5vw, 5.5rem) clamp(4rem, 8vw, 7rem);
    background: var(--tphys-soft);
}

.tphys-tool-directory-group + .tphys-tool-directory-group {
    margin-top: clamp(2rem, 5vw, 3.25rem);
    padding-top: clamp(1.5rem, 4vw, 2.25rem);
    border-top: 1px solid var(--tphys-line);
}

.tphys-tool-directory-group > h3 {
    display: flex;
    gap: 0.7rem;
    align-items: center;
    margin-bottom: 1.1rem;
    color: var(--tphys-navy);
    font-size: clamp(1.25rem, 2vw, 1.6rem);
}

.tphys-tool-directory-group > h3::before {
    content: "";
    width: 0.72rem;
    height: 0.72rem;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--tphys-gold);
}

.tphys-tool-directory-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.tphys-tool-directory-card {
    display: flex;
    min-width: 0;
    min-height: 100%;
    flex-direction: column;
    padding: 1.3rem;
    border: 1px solid var(--tphys-line);
    border-radius: 14px;
    background: var(--tphys-soft);
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.tphys-tool-directory-card:hover,
.tphys-tool-directory-card:focus-within {
    border-color: rgba(10, 95, 150, 0.35);
    box-shadow: 0 12px 26px rgba(6, 47, 83, 0.08);
    transform: translateY(-2px);
}

.tphys-tool-directory-card h4 {
    margin: 0 0 0.55rem;
    color: var(--tphys-navy);
    font-size: 1.08rem;
    line-height: 1.3;
}

.tphys-tool-directory-card h4 a,
.tphys-tool-directory-card h4 a:visited {
    color: inherit;
    text-decoration: none;
}

.tphys-tool-directory-card h4 a:hover,
.tphys-tool-directory-card h4 a:focus {
    color: var(--tphys-blue);
    text-decoration: underline;
}

.tphys-tool-directory-card p {
    margin-bottom: 1rem;
    color: var(--tphys-muted);
    font-size: 0.92rem;
    line-height: 1.55;
}

.tphys-tool-directory-link,
.tphys-tool-directory-link:visited {
    display: inline-flex;
    gap: 0.45rem;
    align-items: center;
    align-self: flex-start;
    margin-top: auto;
    color: var(--tphys-blue);
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
}

.tphys-tool-directory-link:hover,
.tphys-tool-directory-link:focus {
    color: var(--tphys-navy-dark);
    text-decoration: underline;
}

@media (max-width: 1050px) {
    .tphys-tool-directory-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .tphys-tool-directory-grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tphys-tool-directory-card {
        transition: none;
    }
}

/* v11: preserve readable white text on the legacy TWU orange link hover/focus state. */
.tphys-page article a:hover,
.tphys-page article a:focus,
.tphys-page .tphys-tool-card a:hover,
.tphys-page .tphys-tool-card a:focus {
    color: #ffffff !important;
}

/* v13: give the home-page About link a complete, readable hover/focus state.
   Do not depend on a legacy stylesheet to supply the orange background. */
.tphys-page .tphys-about .tphys-text-link:hover,
.tphys-page .tphys-about .tphys-text-link:focus {
    color: #ffffff !important;
    background-color: #d94300 !important;
}

/* v15: shared vertical rhythm for all four new pages.
 * Change the variables near the top of this file to fine-tune globally.
 */
.tphys-hero {
    padding-top: var(--tphys-hero-space);
    padding-bottom: var(--tphys-hero-space);
}

.tphys-method,
.tphys-overview,
.tphys-topics,
.tphys-tools,
.tphys-featured,
.tphys-audience,
.tphys-about,
.tphys-faq {
    padding-top: var(--tphys-section-space);
    padding-bottom: var(--tphys-section-space);
}

.tphys-inner-hero {
    padding-top: var(--tphys-hero-space);
    padding-bottom: var(--tphys-hero-space);
}

.tphys-inner-section,
.tphys-closing {
    padding-top: var(--tphys-section-space-compact);
    padding-bottom: var(--tphys-section-space-compact);
}

.tphys-directory,
.tphys-tool-directory {
    padding-bottom: var(--tphys-section-space);
}

