/* Layout utilities — structural only, no color embellishment */

/* ===== Body padding override ===== */
body {
    padding: 2.618rem 11.09vw;
}

/* ===== Navigation ===== */
nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1.5rem;
    padding: 1rem 11.09vw;
    border-bottom: 1px solid #e5e5e5;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 100;
    margin: -2.618rem -11.09vw 0;
}

nav a {
    font-size: 1rem;
    font-weight: 500;
    white-space: nowrap;
}

/* Dropdown */
.nav-dropdown {
    position: relative;
}

.nav-dropdown > span {
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border: 1px solid #e5e5e5;
    padding: 0.5rem 0;
    min-width: 10rem;
    z-index: 101;
}

.nav-dropdown.open .nav-dropdown-menu {
    display: block;
}

.nav-dropdown-menu a {
    display: block;
    padding: 0.35rem 1rem;
    font-size: 0.9rem;
}

.nav-dropdown-menu a:hover {
    background: #f5f5f5;
}

/* Push Sign In to the right */
nav .nav-signin {
    margin-left: auto;
}

/* ===== Header / Hero ===== */
header {
    text-align: left;
    padding: 6.854rem 11.09vw 4.236rem;
    margin: 0 -11.09vw 2.618rem;
    border-bottom: 1px solid #e5e5e5;
}

header h1 {
    max-width: none;
}

header p {
    max-width: 42rem;
}

/* ===== Inline text links ===== */
p a, li a, td a, .email-notice a {
    text-decoration: none;
    border-bottom: 1px dashed #000;
}

p a:hover, p a:focus,
li a:hover, li a:focus,
td a:hover, td a:focus {
    border-bottom-style: solid;
}

/* ===== Hero Slideshow ===== */
.hero-slides {
    display: flex;
    align-items: stretch;
}

.hero-tabs {
    flex: 0 0 23.6%;
    display: flex;
    flex-direction: column;
    gap: 0;
    border-right: 1px solid #e5e5e5;
}

.hero-content {
    flex: 1 1 61.8%;
    display: grid;
    padding-left: 2.618rem;
}

.hero-slide {
    grid-area: 1 / 1;
    visibility: hidden;
}

.hero-slide.active {
    visibility: visible;
}

.hero-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 1rem 1.618rem;
    background: none;
    border: none;
    border-bottom: 1px solid #e5e5e5;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: background 0.15s;
    width: 100%;
    margin-bottom: 0;
}

.hero-tab + .hero-tab {
    margin-left: 0;
}

.hero-tab:last-child {
    border-bottom: none;
}

.hero-tab:hover {
    background: #fafafa;
}

.hero-tab.active {
    background: #000;
    color: #fff;
}

.hero-tab strong {
    font-size: 1.236rem;
    display: block;
    margin: 0;
    padding: 0;
}

.hero-tab small {
    font-size: 0.854rem;
    color: #999;
    line-height: 1.2;
    margin: 0;
    padding: 0;
}

.hero-tab.active small {
    color: #aaa;
}

@media (max-width: 1000px) {
    .hero-slides {
        flex-direction: column;
    }

    .hero-tabs {
        flex-direction: row;
        border-right: none;
        border-bottom: 1px solid #e5e5e5;
    }

    .hero-tab {
        border-bottom: none;
        border-right: 1px solid #e5e5e5;
        padding: 0.382rem 0.5rem;
        flex: 1 1 0;
        min-width: 0;
        text-align: left;
    }

    .hero-tab strong {
        font-size: 0.75rem;
    }

    .hero-tab small {
        font-size: 0.6rem;
    }

    .hero-tab:last-child {
        border-right: none;
    }

    .hero-tabs {
        margin-bottom: 4.236rem;
    }

    .hero-content {
        padding-left: 0;
    }
}


/* ===== Buttons / CTAs ===== */
button, .cta {
    display: inline-block;
    width: auto;
}

a[href]:where(header a, .card a, section > p > a) {
    display: inline-block;
    border: 2px solid #000;
    padding: 0.618rem 1.618rem;
    font-weight: 700;
    font-size: 1rem;
    margin-top: 0.618rem;
    transition: background 0.15s, color 0.15s;
}

a[href]:where(header a, .card a, section > p > a):hover {
    background: #000;
    color: #fff;
}

/* ===== Cards Grid ===== */
.cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.618rem;
    margin-bottom: 2.618rem;
}

.card {
    border: 1px solid #e5e5e5;
    padding: 1.618rem;
}

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

/* Trait rows — periodic table element style */
.trait-row {
    display: flex;
    gap: 0;
    border: 1px solid #e5e5e5;
    margin-bottom: 1rem;
}

.trait-element {
    flex: 0 0 38.2%;
    border-right: 1px solid #e5e5e5;
    padding: 1.618rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.trait-element small {
    font-size: 0.75rem;
    color: #999;
    line-height: 1.2;
}

.trait-symbol {
    font-size: 4.236rem;
    font-weight: 700;
    line-height: 1.1;
}

.trait-name {
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.05em;
}

/* OCEAN trait colors (matching /results theme) */
.trait-o .trait-symbol, .trait-o .trait-name { color: #9b59b6; }
.trait-c .trait-symbol, .trait-c .trait-name { color: #3498db; }
.trait-e .trait-symbol, .trait-e .trait-name { color: #e6a817; }
.trait-a .trait-symbol, .trait-a .trait-name { color: #2ecc71; }
.trait-n .trait-symbol, .trait-n .trait-name { color: #e74c3c; }

.trait-o { border-left: 4px solid #9b59b6; }
.trait-c { border-left: 4px solid #3498db; }
.trait-e { border-left: 4px solid #e6a817; }
.trait-a { border-left: 4px solid #2ecc71; }
.trait-n { border-left: 4px solid #e74c3c; }

.trait-body {
    flex: 1;
    padding: 1.618rem;
}

.trait-body h3 {
    margin-bottom: 0.618rem;
}

.trait-body p {
    font-size: 1.236rem;
    line-height: 1.618;
}

.trait-body small {
    font-size: 0.854rem;
    color: #666;
}

@media (max-width: 1000px) {
    .trait-row {
        flex-direction: column;
    }

    .trait-element {
        flex: none;
        border-right: none;
        border-bottom: 1px solid #e5e5e5;
        padding: 1rem 1.618rem;
        flex-direction: row;
        gap: 0.75rem;
        text-align: left;
        align-items: center;
        justify-content: flex-start;
    }

    .trait-symbol {
        font-size: 2.618rem;
    }

    .trait-body {
        text-align: left;
    }
}

.card p, .card li {
    font-size: 1.236rem;
    line-height: 1.618;
}

.card small {
    font-size: 0.854rem;
}

/* ===== Two-column variant ===== */
.cards-2 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(24rem, 1fr));
    gap: 1.618rem;
    margin-bottom: 2.618rem;
}

/* ===== Section spacing ===== */
main > section {
    margin-bottom: 4.236rem;
}

/* ===== Main padding for non-hero pages ===== */
main > h1:first-child {
    margin-top: 6.854rem;
}

/* ===== Footer ===== */
footer {
    border-top: 1px solid #e5e5e5;
    padding-top: 2.618rem;
    margin-top: 4.236rem;
}

/* ===== Blockquote ===== */
blockquote {
    border-left: 3px solid #e5e5e5;
    padding-left: 1.618rem;
    margin-bottom: 1.618rem;
}

blockquote p {
    font-size: 1rem;
    color: #555;
    font-style: italic;
    line-height: 1.618;
}


.hero-slide blockquote {
    border-left: none;
    padding: 1rem 1.618rem;
    background: #f8f8f8;
    margin: 1.618rem 0;
}

.hero-slide blockquote p {
    font-size: 1rem;
    font-weight: 400;
    margin-bottom: 0;
}

/* ===== Table improvements ===== */
table {
    width: 100%;
    margin-bottom: 2.618rem;
}

th, td {
    text-align: left;
    padding: 0.618rem 1rem;
    border-bottom: 1px solid #e5e5e5;
    font-size: 1.618rem;
    line-height: 1.618;
}

th {
    font-weight: 700;
}

/* ===== Steps / Flow ===== */
.steps {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 2.618rem;
}

.step {
    display: flex;
    gap: 1.618rem;
    align-items: flex-start;
}

.step-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    width: 3rem;
}

.step-number {
    width: 3rem;
    height: 3rem;
    border: 2px solid #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.236rem;
    font-weight: 700;
}

.step-line {
    width: 2px;
    flex: 1;
    background: #e5e5e5;
    min-height: 1.618rem;
}

.step:last-child .step-line {
    display: none;
}

.step-content {
    flex: 1;
    padding-bottom: 1.618rem;
}

.step-content h3 {
    margin-bottom: 0.382rem;
}

.step-content p {
    font-size: 1.236rem;
    line-height: 1.618;
    color: #444;
}

@media (max-width: 618px) {
    .step-content p {
        font-size: 1rem;
    }
}

/* ===== FAQ Accordion ===== */
.faq {
    border: 1px solid #e5e5e5;
    margin-bottom: 2.618rem;
}

.faq details {
    border-bottom: 1px solid #e5e5e5;
}

.faq details:last-child {
    border-bottom: none;
}

.faq summary {
    padding: 0.75rem 1.618rem;
    cursor: pointer;
    font-size: 1.236rem;
    font-weight: 600;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.faq summary::after {
    content: "+";
    font-size: 1.236rem;
    font-weight: 300;
    color: #999;
}

.faq details[open] summary::after {
    content: "\2212";
}

.faq summary:hover {
    background: #fafafa;
}

.faq details[open] summary {
    border-bottom: 1px solid #e5e5e5;
}

.faq p {
    padding: 1rem 1.618rem;
    font-size: 1rem;
    line-height: 1.618;
    color: #444;
    margin: 0;
}

/* ===== Facet Explorer ===== */
.facet-explorer {
    border: 1px solid #e5e5e5;
    margin: 1.618rem 0 2.618rem;
}

.facet-tabs {
    display: flex;
    border-bottom: 1px solid #e5e5e5;
}

.facet-tab {
    flex: 1;
    padding: 0.75rem 0.5rem;
    background: none;
    border: none;
    border-right: 1px solid #e5e5e5;
    cursor: pointer;
    text-align: center;
    font-family: inherit;
    font-size: 1.618rem;
    font-weight: 700;
    transition: background 0.15s;
    width: auto;
    margin: 0;
}

.facet-tab:last-child {
    border-right: none;
}

.facet-tab small {
    display: block;
    font-size: 0.75rem;
    font-weight: 400;
    color: #999;
    margin: 0;
}

.facet-tab:hover {
    background: #fafafa;
}

.facet-tab.active {
    color: #fff;
}

.facet-tab.active small {
    color: rgba(255,255,255,0.7);
}

/* OCEAN-colored active tabs */
.facet-tab[data-domain="openness"] { color: #9b59b6; border-bottom: 3px solid transparent; }
.facet-tab[data-domain="conscientiousness"] { color: #3498db; border-bottom: 3px solid transparent; }
.facet-tab[data-domain="extraversion"] { color: #e6a817; border-bottom: 3px solid transparent; }
.facet-tab[data-domain="agreeableness"] { color: #2ecc71; border-bottom: 3px solid transparent; }
.facet-tab[data-domain="neuroticism"] { color: #e74c3c; border-bottom: 3px solid transparent; }

.facet-tab[data-domain="openness"].active { background: #9b59b6; color: #fff; }
.facet-tab[data-domain="conscientiousness"].active { background: #3498db; color: #fff; }
.facet-tab[data-domain="extraversion"].active { background: #e6a817; color: #fff; }
.facet-tab[data-domain="agreeableness"].active { background: #2ecc71; color: #fff; }
.facet-tab[data-domain="neuroticism"].active { background: #e74c3c; color: #fff; }

.facet-tab + .facet-tab {
    margin-left: 0;
}

.facet-panel {
    display: none;
    padding: 0;
}

.facet-panel.active {
    display: block;
}

.facet-panel details {
    border-bottom: 1px solid #e5e5e5;
}

.facet-panel details:last-child {
    border-bottom: none;
}

.facet-panel summary {
    padding: 0.75rem 1.618rem;
    cursor: pointer;
    font-size: 1.236rem;
    font-weight: 600;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.facet-panel summary::-webkit-details-marker {
    display: none;
}

.facet-panel summary small {
    font-weight: 400;
    color: #999;
    font-size: 0.75rem;
    margin: 0;
}

.facet-panel summary::after {
    content: "+";
    font-size: 1.236rem;
    font-weight: 300;
    color: #999;
}

.facet-panel details[open] summary::after {
    content: "\2212";
}

.facet-panel summary:hover {
    background: #fafafa;
}

.facet-panel details[open] summary {
    border-bottom: 1px solid #e5e5e5;
}

.facet-panel p {
    padding: 1rem 1.618rem;
    font-size: 1rem;
    line-height: 1.618;
    color: #444;
    margin: 0;
}

/* ===== Blog hero image (first figure only) ===== */
main > h1 + figure {
    width: calc(100% + 2 * 11.09vw);
    margin-left: -11.09vw;
    margin-right: -11.09vw;
    margin-bottom: 2.618rem;
    padding: 0;
    aspect-ratio: 1 / 0.382;
    overflow: hidden;
}

main > h1 + figure img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
}

@media (max-width: 618px) {
    main > h1 + figure {
        width: calc(100% + 2 * 5vw);
        margin-left: -5vw;
        margin-right: -5vw;
        margin-bottom: 1.618rem;
    }
}

/* ===== Inline article figures ===== */
main > figure {
    margin: 1.618rem 0;
}

main > figure img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}

main > figure:has(.article-float) {
    float: right;
    max-width: 50%;
    margin: 0 0 1rem 1.618rem;
}

main > figure:has(.article-float) img {
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

@media (max-width: 618px) {
    main > figure:has(.article-float) {
        float: none;
        max-width: 100%;
        margin: 0 0 1rem 0;
    }
}

/* ===== Blog / Article lists ===== */
main > ul,
main > ol {
    margin-bottom: 1.618rem;
    padding-left: 1.618rem;
}

main > ul {
    list-style: disc;
}

main > ol {
    list-style: decimal;
}

main > ul li,
main > ol li {
    font-size: 1.618rem;
    line-height: 1.618;
    margin-bottom: 0.618rem;
    color: #000;
    font-weight: 300;
}

main > ul li b,
main > ol li b {
    font-weight: 700;
}

/* ===== Table of Contents ===== */
.toc {
    border: 1px solid #e5e5e5;
    padding: 1.618rem;
    margin: 1.618rem 0 2.618rem;
    position: static;
    background: #fafafa;
}

.toc p {
    margin-bottom: 0.618rem;
}

.toc ol {
    list-style: decimal;
    padding-left: 1.618rem;
}

.toc li {
    font-size: 1rem;
    line-height: 2;
}

/* ===== Comparison table ===== */
main table th,
main table td {
    font-size: 1rem;
    padding: 0.5rem 0.75rem;
}

/* ===== Citations ===== */
.citations p {
    font-size: 1rem;
    color: #666;
}

.citations p i {
    font-size: inherit;
}

/* ===== Dashboard ===== */
.dash-first-section blockquote,
.dash-first-section + section blockquote {
    max-width: 61.8%;
}

@media (max-width: 1000px) {
    .dash-first-section blockquote,
    .dash-first-section + section blockquote {
        max-width: 100%;
    }
}

.dash-first-section {
    margin-top: 6.854rem;
}

.dash-action-grid {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.dash-action-card {
    flex: 1 1 22%;
    min-width: 12rem;
    border: 1px solid #e5e5e5;
    padding: 0.618rem 1rem;
}

@media (max-width: 1200px) {
    .dash-action-card {
        flex: 1 1 45%;
    }
}

@media (max-width: 618px) {
    .dash-action-card {
        flex: 1 1 100%;
    }
}

.dash-action-card.disabled {
    opacity: 0.5;
}

.dash-action-card p {
    font-size: 0.854rem;
    margin: 0;
}

.dash-action-btn {
    display: inline-block;
    float: right;
    border: 1px solid #000;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
    text-decoration: none;
    color: #000;
    transition: background 0.15s, color 0.15s;
    width: auto;
    margin: 0 0 0.25rem 0.75rem;
}

.dash-action-btn:hover,
.dash-action-btn:focus {
    background: #000;
    color: #fff;
}

.dash-action-btn.coming-soon {
    border-color: #999;
    color: #999;
    cursor: default;
}

.dash-action-btn.coming-soon:hover,
.dash-action-btn.coming-soon:focus {
    background: transparent;
    color: #999;
}

.dash-subtitle {
    font-size: 0.854rem;
    color: #888;
}

.dash-account {
    border-top: 1px solid #e5e5e5;
    padding-top: 1.618rem;
    margin-top: 4.236rem;
    text-align: center;
}

.dash-account p {
    font-size: 0.854rem;
    color: #999;
}

/* ===== Dashboard table to cards on mobile/tablet ===== */
@media (max-width: 1000px) {
    #results-table thead,
    #reports-table thead {
        display: none;
    }

    #results-table,
    #results-table tbody,
    #results-table tr,
    #results-table td,
    #reports-table,
    #reports-table tbody,
    #reports-table tr,
    #reports-table td {
        display: block;
        width: 100%;
    }

    #results-table tr,
    #reports-table tr {
        border: 1px solid #e5e5e5;
        padding: 0.618rem 1rem;
        margin-bottom: 0.618rem;
    }

    #results-table td,
    #reports-table td {
        border: none;
        padding: 0.15rem 0;
        font-size: 0.9rem;
        display: flex;
        align-items: baseline;
    }

    #results-table tr,
    #reports-table tr {
        display: flex;
        flex-wrap: wrap;
    }

    #results-table td[data-label],
    #reports-table td[data-label] {
        width: 100%;
    }

    #results-table td:not([data-label]),
    #reports-table td:not([data-label]) {
        display: inline-block;
        width: auto;
        padding: 0;
        margin-top: 0.382rem;
        margin-right: 0.382rem;
        border: 1px solid #e5e5e5;
        font-size: 0.75rem;
    }

    #results-table td:not([data-label]) a,
    #reports-table td:not([data-label]) a {
        display: block;
        padding: 0.25rem 0.618rem;
        margin: 0;
        border: 0;
        line-height: 1.4;
    }

    #results-table td:not([data-label]):empty,
    #reports-table td:not([data-label]):empty {
        display: none;
    }

    #results-table td:not([data-label])::before,
    #reports-table td:not([data-label])::before {
        display: none;
    }

    #results-table td::before,
    #reports-table td::before {
        content: attr(data-label);
        font-weight: 700;
        font-size: 0.75rem;
        color: #999;
        flex-shrink: 0;
        min-width: 5rem;
        margin-right: 1rem;
    }
}

/* ===== Auth Modal ===== */
/* Modal overlay */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    background: rgba(0,0,0,0.4);
}

#auth-modal { display: none; }

/* Modal box */
.modal-box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border: 1px solid #e5e5e5;
    padding: 2.618rem;
    max-width: 26rem;
    width: 90%;
    box-sizing: border-box;
}

.modal-box h2 {
    margin: 0 0 1rem;
}

.modal-close {
    position: absolute;
    top: 1.618rem;
    right: 1.618rem;
    font-size: 1.618rem;
    color: #999;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    width: auto;
    margin: 0;
    font-family: inherit;
    line-height: 1;
}

.modal-close:hover {
    color: #000;
}

.modal-box label {
    font-size: 0.854rem;
    color: #666;
    margin-bottom: 0.382rem;
    padding: 0;
    display: block;
    width: 100%;
}

.modal-box input {
    margin-bottom: 0.618rem;
    font-size: 1rem;
    padding: 0.618rem;
    width: 100%;
    box-sizing: border-box;
}

.modal-box button[type="submit"] {
    margin: 0;
    margin-left: 0;
    font-weight: 700;
    font-size: 1rem;
    padding: 0.618rem;
}

.modal-box .auth-hint {
    font-size: 0.854rem;
    color: #666;
    margin-top: 0.618rem;
}


/* Alert boxes */
.modal-box .alert,
.alert {
    display: block;
    padding: 0.618rem 1rem;
    margin: 0 0 0.618rem 0;
    font-size: 0.9rem;
    width: 100%;
    box-sizing: border-box;
}

.alert-error {
    background: #fdd;
    color: #c44;
    border: 1px solid #c44;
}

.alert-success {
    background: #dfd;
    color: #2a7;
    border: 1px solid #2a7;
}

.alert-warning {
    background: #fef3cd;
    color: #000;
    border: 1px solid #e6a817;
}

.alert a {
    color: inherit;
}

#auth-msg {
    display: none;
}

/* CTA button */
a.btn-cta, a.btn-cta:link, a.btn-cta:visited, a.btn-cta:active,
button.btn-cta, .btn-cta {
    display: inline-block;
    padding: 0.618rem 1.618rem;
    background: #000;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    border: 2px solid #000;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

a.btn-cta:hover, a.btn-cta:focus,
button.btn-cta:hover, button.btn-cta:focus {
    background: #fff;
    color: #000;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Responsive ===== */
@media (max-width: 618px) {
    body {
        padding: 1rem 5vw;
    }

    nav {
        padding: 0.75rem 5vw;
        gap: 0.25rem 1rem;
        margin: -1rem -5vw 0;
    }

    nav a {
        font-size: 0.85rem;
    }

    header {
        padding: 4.236rem 5vw 2.618rem;
        margin: 0 -5vw 1.618rem;
    }

    .cards-2 {
        grid-template-columns: 1fr;
    }

    th, td {
        padding: 0.5rem 0.5rem;
        font-size: 1.2rem;
    }
}

/* ===== Framework diagrams ===== */
.framework-diagram {
    float: right;
    width: 50%;
    margin: 0 0 1rem 1.5rem;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
}

@media (max-width: 618px) {
    .framework-diagram {
        float: none;
        width: 100%;
        margin: 0 0 1.5rem 0;
    }
}
