/* Lorissa H. */
/* Final project stylesheet: minimalist, professional, with PNW-inspired accents. */

/* Reset the browser defaults so spacing is predictable across the whole page. */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Main color palette for the page. */
:root {
    --font-body: Charter, "Iowan Old Style", Cambria, Georgia, "Times New Roman", serif;
    --font-heading: Charter, "Iowan Old Style", Georgia, "Times New Roman", serif;
    --page: #f7f7f2;
    --surface: rgba(255, 255, 250, 0.96);
    --surface-strong: #ffffff;
    --text: #252a27;
    --muted: #56615b;
    --line: #cfd8cf;
    --green: #2f5d4a;
    --green-dark: #17382b;
    --green-soft: #e4eee8;
    --moss: #8a9a5b;
    --shadow: 0 14px 34px rgba(31, 63, 50, 0.12);
    --shadow-soft: 0 8px 22px rgba(31, 63, 50, 0.09);
}

/* Enables smooth scrolling for in-page links. */
html {
    scroll-behavior: smooth;
}

/* Sets the main page width, typography, and background color. */
body {
    min-height: 100vh;
    max-width: 1120px;
    margin: 0 auto;
    padding: 48px 28px;
    position: relative;
    font-family: var(--font-body);
    font-size: 19px;
    font-weight: 400;
    line-height: 1.66;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(228, 238, 232, 0.9), transparent 34rem),
        linear-gradient(180deg, #fbfbf7 0%, var(--page) 100%);
}

/* Adds the transparent redwoods background image behind the content. */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(247, 247, 242, 0.66), rgba(247, 247, 242, 0.88)),
        url("redwoods-background.png");
    background-position: center;
    background-size: cover;
    opacity: 0.95;
    z-index: -1;
}

/* Project detail pages use a quiet warm paper texture instead of a scenic image. */
body.project-detail::before {
    background-image:
        radial-gradient(circle at 20% 18%, rgba(138, 116, 75, 0.035), transparent 18rem),
        radial-gradient(circle at 78% 64%, rgba(138, 116, 75, 0.03), transparent 20rem),
        linear-gradient(180deg, #fbfaf3 0%, #f7f2e6 100%);
    background-position:
        center,
        center,
        center;
    background-size:
        auto,
        auto,
        auto;
    opacity: 1;
}

/* Gives the major page areas a light panel effect so the text stays readable. */
header,
footer {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(4px);
}

/* Styles the top introduction area. */
header {
    padding: 50px 56px 42px;
    border-bottom: 5px solid var(--green);
}

/* Places intro text and profile photo side by side on larger screens. */
.profile-header {
    display: flex;
    align-items: center;
    gap: 28px;
}

/* Allows the intro text to take up the available space next to the image. */
.profile-text {
    flex: 1;
}

/* Keeps the profile picture consistently sized and cropped. */
.profile-photo {
    width: 190px;
    aspect-ratio: 1;
    object-fit: cover;
    object-position: center;
    border-radius: 24px;
    border: 4px solid var(--surface-strong);
    box-shadow: 0 0 0 1px var(--line);
}

/* Keeps email and phone links grouped without crowding them. */
.contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin-bottom: 0;
}

/* Slightly sizes down the contact links so they do not overpower the header. */
.contact-links a {
    font-size: 0.98rem;
}

/* Creates space between the header and the individual content sections. */
main {
    display: grid;
    gap: 18px;
    margin-top: 24px;
}

/* Keeps the footer simple and secondary. */
footer {
    margin-top: 24px;
    padding: 24px 56px;
    color: var(--muted);
    font-size: 0.95rem;
    text-align: center;
}

/* Shared heading style for a consistent hierarchy. */
h1,
h2,
h3 {
    font-family: var(--font-heading);
    line-height: 1.2;
    color: var(--green-dark);
    font-weight: 600;
}

strong,
b {
    font-weight: 650;
}

/* Main name heading in the header. */
h1 {
    font-size: 2.58rem;
    margin-bottom: 10px;
    letter-spacing: 0;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.72);
}

body.project-detail > header h1 {
    font-size: 2.2rem;
}

.thesis-title {
    max-width: none;
    font-size: 1.95rem;
}

.thesis-title-subtitle {
    display: block;
    margin-top: 6px;
    color: #496f40;
    font-size: 0.8em;
    font-style: italic;
    font-weight: 650;
}

/* Section headings for each major part of the page. */
h2 {
    margin: 38px 0 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
    font-size: 1.65rem;
}

/* Small moss dot detail before section headings. */
h2::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 10px;
    border-radius: 50%;
    background: var(--moss);
    vertical-align: 0.16em;
}

/* Subheadings for schools, jobs, and projects. */
h3 {
    margin: 24px 0 8px;
    font-size: 1.2rem;
}

/* Subtle divider under the header intro. */
hr {
    width: 100%;
    max-width: 420px;
    margin: 20px 0 14px;
    border: 0;
    border-top: 1px solid var(--line);
}

/* Standard paragraph spacing. */
p {
    margin-bottom: 16px;
}

/* Link styling with a quiet green accent. */
a {
    color: var(--green);
    font-weight: 600;
    text-decoration-thickness: 2px;
    text-decoration-color: rgba(47, 93, 74, 0.62);
    text-underline-offset: 4px;
}

/* Makes links feel interactive when hovered or focused. */
a:hover,
a:focus {
    color: var(--green-dark);
    text-decoration-color: var(--green-dark);
}

/* Navigation styling for an optional menu. */
nav {
    margin-top: 24px;
}

/* Keeps navigation links in a flexible row. */
nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    list-style: none;
}

/* Makes nav links look like clean, small buttons. */
nav a {
    display: inline-block;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-strong);
    color: var(--green-dark);
    text-decoration: none;
}

/* Adds a soft green hover effect to nav links. */
nav a:hover,
nav a:focus {
    border-color: var(--green);
    background: var(--green-soft);
}

/* Adds breathing room inside each content section while softly showing the background around it. */
section {
    padding: 34px 56px 38px;
    border: 1px solid rgba(207, 216, 207, 0.9);
    border-radius: 22px;
    background: rgba(255, 255, 250, 0.93);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(4px);
}

/* Keeps the first heading in each section from adding extra top space. */
section h2:first-child {
    margin-top: 0;
}

.project-overview .overview-lead {
    color: var(--green-dark);
    font-weight: 700;
}

/* Sets consistent spacing for both ordered and unordered lists. */
ul,
ol {
    margin: 0 0 16px 24px;
}

/* Keeps list items readable instead of cramped. */
li {
    margin-bottom: 8px;
}

/* Makes images responsive so they do not overflow on small screens. */
img {
    max-width: 100%;
    height: auto;
    border-radius: 14px;
    border: 1px solid var(--line);
}

/* Optional blockquote styling for quotes or callouts. */
blockquote {
    margin: 20px 0;
    padding: 14px 18px;
    border-left: 4px solid var(--green);
    border-radius: 10px;
    background: var(--green-soft);
    color: var(--green-dark);
}

.interpretation-section h3 {
    max-width: 860px;
    margin: 22px 0 10px;
    padding: 6px 10px;
    border-radius: 6px;
    color: var(--green-dark);
    background: rgba(228, 238, 232, 0.62);
    font-size: 1.3rem;
    font-style: italic;
    font-weight: 550;
    line-height: 1.35;
}

.interpretation-section p {
    max-width: 860px;
}

/* Table styling for structured information. */
table {
    width: 100%;
    margin: 20px 0;
    border-collapse: collapse;
    border-radius: 12px;
    overflow: hidden;
    background: var(--surface-strong);
}

/* Keeps table cells readable and aligned. */
th,
td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

td:not(:first-child) {
    text-align: right;
}

.summary-table td:nth-child(2) {
    text-align: right;
}

table.summary-table {
    width: auto;
    max-width: 720px;
    margin: 20px 0;
}

table.summary-table thead th {
    background: rgba(54, 108, 85, 0.72);
    color: var(--text);
}

table.summary-table tfoot td {
    border-top: 1px solid var(--line);
    font-weight: 600;
}

table.summary-table td:first-child {
    text-align: left;
}


.summary-table td:nth-child(3) {
    text-align: left;
}

/* Highlights table headers with the soft green accent. */
th {
    color: var(--green-dark);
    background: rgba(157, 204, 181, 0.395);
    font-weight: 650;
}

/* Softly marks important p-values without overpowering the table. */
td.p-value-highlight {
    border-radius: 8px;
    background: rgba(228, 238, 232, 0.78);
    color: var(--green-dark);
    font-weight: 700;
}

.table-note {
    margin-top: -10px;
    color: var(--muted);
    font-size: 0.9rem;
}

.chart-interpretation {
    margin: 10px 0 18px;
    color: var(--green-dark);
    line-height: 1.5;
}

/* Shared styling for buttons and button-like links. */
button,
.button {
    display: inline-block;
    padding: 11px 18px;
    border: 1px solid var(--green);
    border-radius: 10px;
    background: var(--green);
    color: #ffffff;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

/* Darkens buttons on hover/focus for clearer interaction feedback. */
button:hover,
button:focus,
.button:hover,
.button:focus {
    background: var(--green-dark);
    border-color: var(--green-dark);
}

.button.resume-button {
    background: transparent;
    color: var(--green-dark);
    border-color: var(--muted);
    box-shadow: none;
}

.button.resume-button:hover,
.button.resume-button:focus {
    background: rgba(214, 231, 220, 0.3);
    border-color: var(--green-dark);
    color: var(--green-dark);
}

#experience .button {
    margin-top: 20px;
}

/* Intro/subtitle text should feel quieter than the main heading. */
.intro,
.subtitle {
    max-width: 760px;
    color: var(--muted);
    font-size: 1.08rem;
}

.thesis-subtitle {
    max-width: 880px;
    color: #3f4f47;
    font-size: 1.32rem;
    line-height: 1.5;
}

.profile-tagline {
    max-width: 820px;
    color: #3f4f47;
    font-size: 1.3rem;
    font-style: italic;
    font-weight: 400;
    line-height: 1.48;
}

/* Small highlight style for key phrases. */
.highlight {
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--green-soft);
    color: var(--green-dark);
    font-weight: 650;
}

/* Simple card style for repeated content blocks. */
.card {
    margin: 18px 0;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-strong);
}

/* Organizes featured projects across the page. */
.featured-projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

/* Keeps featured project entries distinct without making them feel heavy. */
.featured-project {
    display: flex;
    flex-direction: column;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.76);
    box-shadow: 0 8px 18px rgba(31, 63, 50, 0.08);
}

/* Keeps project titles compact inside the horizontal layout. */
.featured-project h3 {
    margin-top: 0;
    color: var(--green-dark);
    font-size: 1.28rem;
    font-weight: 600;
}

/* Pushes each project button to the bottom of its block. */
.featured-project .button {
    align-self: center;
    margin-top: auto;
}

/* Secondary details like dates and locations. */
.details {
    color: var(--muted);
    font-size: 1.02rem;
}

/* Project detail pages use the same panels with focused code examples. */
.project-page {
    display: block;
}

.project-page section {
    margin-top: 20px;
}

.project-nav {
    margin: 0 0 18px;
}

.code-sample {
    overflow-x: auto;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #1f2a24;
    color: #f4f7f1;
    font-size: 1rem;
    line-height: 1.5;
}

.model-spec {
    overflow-x: auto;
    margin: 18px 0;
    padding: 20px 22px;
    border: 1px solid rgba(138, 154, 91, 0.48);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 8px 18px rgba(31, 63, 50, 0.06);
    text-align: center;
}

.model-equation {
    display: inline-block;
    min-width: max-content;
    color: var(--green-dark);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.48rem;
    font-weight: 400;
    line-height: 1.45;
}

.project-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* Keeps project screenshots polished and full-width. */
.scene-image {
    display: block;
    width: 100%;
    margin-top: 14px;
    border-radius: 18px;
    box-shadow: var(--shadow-soft);
}

/* Pairs project takeaways with supporting visuals when a notebook has one. */
.takeaway-plot {
    margin: 18px 0;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.58);
}

.takeaway-plot p {
    margin-bottom: 12px;
}

.takeaway-plot h3 {
    margin-top: 0;
    margin-bottom: 8px;
}

.takeaway-plot img {
    display: block;
    width: 100%;
    background: #ffffff;
}

/* Gives standalone graphs their own rounded visual container. */
.graph-bubble {
    margin: 16px 0 24px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 8px 18px rgba(31, 63, 50, 0.08);
}

.graph-bubble img {
    display: block;
    width: 100%;
    border: 1px solid var(--line);
    background: #ffffff;
}

/* Highlights compact code snippets and numeric results on project pages. */
.result-bubble {
    margin: 16px 0 24px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 8px 18px rgba(31, 63, 50, 0.08);
}

.result-bubble pre {
    overflow-x: auto;
    margin-bottom: 12px;
    padding: 14px;
    border-radius: 14px;
    background: #1f2a24;
    color: #f4f7f1;
    font-size: 0.98rem;
    line-height: 1.45;
}

.result-line {
    margin-bottom: 6px;
    color: var(--green-dark);
    font-size: 1.1rem;
    font-weight: 800;
}

.note {
    color: var(--muted);
    font-size: 0.96rem;
}

/* Full notebook exports keep cells readable inside the site design. */
.notebook-cell {
    margin-top: 20px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(255, 255, 250, 0.93);
    box-shadow: var(--shadow-soft);
}

.notebook-cell h1,
.notebook-cell h2,
.notebook-cell h3,
.notebook-cell h4 {
    margin-top: 0;
}

.cell-label {
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.notebook-output {
    overflow-x: auto;
    margin-top: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-strong);
    color: var(--text);
    font-size: 0.92rem;
    line-height: 1.45;
}

.notebook-plot {
    display: block;
    max-width: 100%;
    margin-top: 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: #ffffff;
}

.notebook-html-output {
    overflow-x: auto;
    margin-top: 12px;
}


/* Gives the thesis highlight a stronger first-position treatment in featured projects. */
.featured-project-spotlight {
    margin-bottom: 22px;
    border-color: rgba(47, 93, 74, 0.38);
    background: rgba(228, 238, 232, 0.78);
}

.featured-project-spotlight h3 {
    font-size: 1.48rem;
}

/* Thesis page layouts for evidence, metrics, and paired plots. */
.thesis-actions {
    margin-top: 20px;
}

.metric-grid,
.evidence-grid,
.plot-grid {
    display: grid;
    gap: 18px;
}

.metric-grid {
    grid-template-columns: repeat(3, 1fr);
    margin-top: 18px;
}

.evidence-grid,
.plot-grid {
    grid-template-columns: repeat(2, 1fr);
}

.plot-grid.centered-plots {
    grid-template-columns: 1fr;
    justify-items: center;
}

.plot-grid.centered-plots .graph-bubble {
    width: min(560px, 100%);
}

.metric-card,
.evidence-card {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 8px 18px rgba(31, 63, 50, 0.06);
}

.metric-value {
    margin-bottom: 4px;
    color: var(--green-dark);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.1;
}

.evidence-card h3,
.metric-card p:last-child {
    margin-top: 0;
}

.evidence-card h3 {
    margin: 24px 0 8px;
    padding: 0;
    background: transparent;
    font-style: normal;
    font-size: 1.3rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--green-dark);
}

.index-visual {
    display: grid;
    gap: 18px;
    margin-top: 18px;
}

.engagement-index-section .index-visual {
    margin-top: 6px;
}

.engagement-index-section > p {
    margin-bottom: 8px;
}

.index-scale,
.index-formula {
    display: grid;
    gap: 10px;
}

.index-scale {
    grid-template-columns: repeat(6, 1fr);
}

.index-band,
.formula-card,
.activity-phase-chart {
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 8px 18px rgba(31, 63, 50, 0.06);
}

.index-band {
    min-height: 118px;
    padding: 14px 12px;
    border-radius: 16px;
    border-top-width: 6px;
}

.index-band.delivery {
    border-top-color: #9b6a57;
}

.index-band.no-engagement {
    border-top-color: #b9aa83;
}

.index-band.opened {
    border-top-color: #9caf88;
}

.index-band.partial {
    border-top-color: #789b78;
}

.index-band.complete {
    border-top-color: #4f7d65;
}

.index-band.substantive {
    border-top-color: var(--green-dark);
}

.index-score,
.formula-value,
.phase-value {
    display: block;
    color: var(--green-dark);
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 800;
    line-height: 1.1;
}

.index-score {
    margin-bottom: 8px;
    font-size: 1.45rem;
}

.index-formula {
    align-items: stretch;
    grid-template-columns: 1fr auto 1fr auto 1.45fr auto 1.35fr;
}

.formula-card {
    padding: 16px;
    border-radius: 16px;
}

.formula-value {
    margin-bottom: 6px;
    font-size: 1.35rem;
}

.formula-operator {
    align-self: center;
    color: var(--moss);
    font-size: 1.4rem;
    font-weight: 800;
}

.activity-phase-chart {
    margin: 18px 0;
    padding: 20px;
    border-radius: 18px;
}

.activity-phase-chart h3 {
    margin-top: 0;
    text-align: center;
}

.phase-bars {
    display: grid;
    align-items: end;
    grid-template-columns: repeat(6, 1fr);
    gap: 14px;
    min-height: 260px;
    padding-top: 12px;
}

.phase-bar {
    display: grid;
    align-items: end;
    grid-template-rows: auto 1fr auto;
    min-height: 238px;
    text-align: center;
}

.phase-fill {
    display: block;
    width: 100%;
    height: var(--bar-height);
    min-height: 16px;
    border-radius: 8px 8px 0 0;
    background: #5f8e4f;
}

.phase-value {
    margin-bottom: 8px;
    font-size: 1rem;
}

.phase-label {
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 700;
}

.insight-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-top: 18px;
}

.insight-card,
.chart-panel {
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 8px 18px rgba(31, 63, 50, 0.06);
}

.insight-card {
    padding: 18px;
    border-radius: 18px;
}

.insight-card h3,
.chart-panel h3 {
    margin-top: 0;
}

.insight-value {
    margin-bottom: 10px;
    color: var(--green-dark);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}

.chart-panel {
    margin-top: 18px;
    padding: 20px;
    border-radius: 18px;
}

.chart-section {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
}

.chart-card {
    padding: 34px 56px 38px;
    border: 1px solid rgba(207, 216, 207, 0.9);
    border-radius: 22px;
    background: rgba(255, 255, 250, 0.93);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(4px);
}

.chart-copy h2 {
    margin-top: 0;
}

.chart-section .chart-panel {
    margin-top: 22px;
}

.segment-chart,
.activity-change-chart {
    display: grid;
    gap: 10px;
}

.segment-row,
.activity-change-row {
    display: grid;
    align-items: center;
    grid-template-columns: minmax(136px, 0.9fr) 1fr 64px;
    gap: 12px;
    padding: 10px;
    border-radius: 12px;
}

.highlight-row {
    background: rgba(228, 238, 232, 0.7);
}

.segment-label {
    color: var(--green-dark);
    font-weight: 700;
}

.segment-track,
.mini-bar {
    height: 16px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(207, 216, 207, 0.62);
}

.segment-fill,
.mini-bar span {
    display: block;
    width: var(--bar-width);
    height: 100%;
    border-radius: inherit;
    background: #5f8e4f;
}

.segment-score {
    color: var(--green-dark);
    font-weight: 800;
    text-align: right;
}

.thesis-page .graph-bubble h3 {
    margin-top: 0;
}

/* Mobile layout adjustments so the page still works on phones. */
@media (max-width: 700px) {
    /* Reduces the outer page padding on smaller screens. */
    body {
        padding: 22px 14px;
        font-size: 17px;
    }

    /* Keeps the main panels from feeling too tight on mobile. */
    header,
    footer {
        padding-left: 22px;
        padding-right: 22px;
    }

    /* Reduces section padding on smaller screens. */
    section {
        padding: 26px 22px 28px;
    }

    .chart-section {
        padding: 0;
    }

    .chart-card {
        padding: 26px 22px 28px;
    }

    /* Stacks featured projects so they stay readable on narrow screens. */
    .featured-projects-grid {
        grid-template-columns: 1fr;
    }

    /* Stacks the intro text and profile photo on narrow screens. */
    .profile-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 18px;
    }

    /* Makes the profile photo smaller on mobile. */
    .profile-photo {
        width: 136px;
    }

    /* Stacks contact links so they are easy to tap. */
    .contact-links {
        display: block;
    }

    /* Adds space between stacked contact links. */
    .contact-links a {
        display: block;
        margin-bottom: 6px;
    }

    /* Scales the main heading down on mobile. */
    h1 {
        font-size: 2.08rem;
    }

    body.project-detail > header h1 {
        font-size: 1.86rem;
    }

    h2 {
        font-size: 1.55rem;
    }

    h3 {
        font-size: 1.18rem;
    }

    /* Stacks nav links on small screens. */
    nav ul {
        display: block;
    }

    /* Adds spacing between stacked nav list items. */
    nav li {
        margin-bottom: 8px;
    }

    /* Makes nav links full width for easier tapping. */
    nav a {
        width: 100%;
    }
}

@media (max-width: 900px) {
    .metric-grid,
    .evidence-grid,
    .plot-grid,
    .insight-grid,
    .index-scale,
    .index-formula,
    .phase-bars {
        grid-template-columns: 1fr;
    }

    .formula-operator {
        display: none;
    }

    .index-band {
        min-height: auto;
    }

    .phase-bars {
        align-items: stretch;
        min-height: auto;
    }

    .phase-bar {
        grid-template-columns: 78px 1fr 92px;
        grid-template-rows: auto;
        align-items: center;
        min-height: auto;
        text-align: left;
    }

    .phase-fill {
        width: var(--bar-height);
        height: 18px;
        border-radius: 0 8px 8px 0;
    }

    .phase-value,
    .phase-label {
        margin: 0;
    }

    .segment-row,
    .activity-change-row {
        grid-template-columns: 1fr;
    }

    .segment-score {
        text-align: left;
    }
}

/* Print-friendly layout for PDF review copies. */
@media print {
    @page {
        size: letter;
        margin: 0.55in;
    }

    * {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    html,
    body {
        width: auto;
        max-width: none;
        margin: 0;
        padding: 0;
        background: #fbfaf3;
        color: #252a27;
        font-size: 11pt;
        line-height: 1.45;
    }

    body::before {
        display: none;
    }

    header,
    footer,
    section {
        margin: 0 0 16pt;
        padding: 18pt;
        border: 1px solid #cfd8cf;
        border-radius: 10pt;
        background: #ffffff;
        box-shadow: none;
    }

    header {
        border-bottom: 4pt solid #2f5d4a;
    }

    main {
        display: block;
        margin-top: 14pt;
    }

    h1 {
        font-size: 22pt;
    }

    body.project-detail > header h1 {
        font-size: 20pt;
    }

    .thesis-title {
        font-size: 18pt;
    }

    h2 {
        margin: 20pt 0 10pt;
        font-size: 16pt;
    }

    section h2:first-child {
        margin-top: 0;
    }

    h3 {
        font-size: 12.5pt;
    }

    p,
    li {
        orphans: 3;
        widows: 3;
    }

    a {
        color: #17382b;
        text-decoration: none;
    }

    .project-nav,
    .project-actions,
    nav,
    .button {
        display: none;
    }

    .metric-grid,
    .evidence-grid,
    .plot-grid,
    .insight-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10pt;
    }

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

    .index-scale,
    .index-formula,
    .phase-bars,
    .segment-chart,
    .activity-change-chart {
        gap: 7pt;
    }

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

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

    .formula-operator {
        display: none;
    }

    .phase-bars {
        min-height: 190pt;
    }

    .phase-bar {
        min-height: 168pt;
    }

    .metric-card,
    .evidence-card,
    .index-band,
    .formula-card,
    .activity-phase-chart,
    .insight-card,
    .model-spec {
        background: #ffffff;
        box-shadow: none;
        break-inside: avoid;
    }

    .metric-value,
    .insight-value {
        font-size: 16pt;
    }

    .index-score {
        font-size: 13pt;
    }

    .formula-value {
        font-size: 12.5pt;
    }

    .phase-value {
        font-size: 10.5pt;
    }

    .insight-grid {
        break-inside: auto;
    }

    .insight-card {
        min-height: auto;
    }

    .chart-panel {
        display: block !important;
        width: auto !important;
        max-width: none !important;
        margin-top: 14pt;
        background: #ffffff;
        box-shadow: none;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .segment-chart,
    .activity-change-chart {
        display: table !important;
        table-layout: fixed;
        width: 100% !important;
        max-width: none !important;
        border-collapse: separate;
        border-spacing: 0 6pt;
    }

    .activity-phase-chart,
    table,
    .plot-grid,
    .index-visual {
        break-inside: avoid;
    }

    .segment-row,
    .activity-change-row {
        display: table-row !important;
        width: 100%;
        padding: 6pt;
    }

    .segment-row > span,
    .activity-change-row > span {
        display: table-cell !important;
        vertical-align: middle;
        padding: 4pt 6pt;
    }

    .segment-label {
        width: 120pt;
    }

    .segment-track,
    .mini-bar {
        display: block !important;
        width: 100% !important;
        height: 10pt;
    }

    .segment-score {
        text-align: right !important;
    }

    img,
    table,
    pre {
        max-width: 100%;
    }
}
