/* Brady Moss | CS 110, Project 8 */

/* Global styles */
:root {
    --ink: #173c32;
    --paper: #faf8f0;
    --muted: #53635a;
    --rule: #c7cbbf;
    --gold: #e7c078;
    --serif: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    position: relative;
    isolation: isolate;
    background-color: var(--paper);
    color: var(--ink);
    font-family: "Source Sans 3", "Segoe UI", Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
}

/* Keep the topographic background faint behind the résumé text. */
body:before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background: url("contours.png") center / cover;
    opacity: 0.08;
    pointer-events: none;
}

.wrap {
    width: min(90%, 68rem);
    margin-inline: auto;
}

h1, h2, h3, p, ul, figure { margin: 0; }

h1, h2, h3, .signature {
    font-family: var(--serif);
    font-weight: 400;
    line-height: 1.1;
}

h2 {
    margin-bottom: 1.1rem;
    font-size: clamp(2rem, 3.6vw, 3.15rem);
    letter-spacing: -0.045em;
}

h3 {
    margin-bottom: 0.45rem;
    font-size: 1.45rem;
}

p + p { margin-top: 0.85rem; }

a {
    color: inherit;
    text-underline-offset: 0.23em;
    text-decoration-thickness: 1px;
}

a:hover { text-decoration-thickness: 2px; }

a:focus-visible {
    outline: 3px solid currentColor;
    outline-offset: 4px;
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -6rem;
    z-index: 2;
    padding: 0.5rem 1rem;
    background: var(--paper);
}

.skip-link:focus { top: 0.5rem; }

/* Navigation and introduction */
.masthead, nav, address, footer {
    display: flex;
    align-items: center;
    gap: 1.35rem;
}

.masthead, footer {
    justify-content: space-between;
    padding-block: 1.05rem;
}

.signature {
    font-size: 1.8rem;
    font-style: italic;
    letter-spacing: -0.07em;
    text-decoration: none;
}

nav a, footer a {
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
}

nav a:hover, footer a:hover { text-decoration: underline; }

.hero {
    background: linear-gradient(110deg, #133a31 13%, rgba(19, 58, 49, 0.89)),
        url("contours.png") center / cover, var(--ink);
    color: var(--paper);
    border-bottom: 3px solid var(--gold);
}

.intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(13rem, 17rem);
    align-items: center;
    gap: clamp(2rem, 6vw, 6rem);
    padding-block: clamp(2.5rem, 5vw, 4rem);
}

.location, .organization, .degree-date {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.location { color: var(--gold); }

h1 {
    margin: 0.55rem 0 0.7rem;
    font-size: clamp(3.6rem, 7.6vw, 6.85rem);
    letter-spacing: -0.065em;
}

h1 em { color: #f2d198; }

.subtitle {
    max-width: 29rem;
    font-family: var(--serif);
    font-size: clamp(1.25rem, 2.4vw, 1.8rem);
    line-height: 1.3;
}

hr {
    margin: 1.6rem 0 1.1rem;
    border: 0;
    border-top: 1px solid #709081;
}

address {
    flex-wrap: wrap;
    gap: 0.4rem 1.25rem;
    font-size: 0.9rem;
    font-style: normal;
}

/* Framed presentation headshot */
.portrait {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 5;
    border: 3px solid var(--paper);
}

.portrait img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

figcaption {
    display: flex;
    justify-content: space-between;
    gap: 0.4rem;
    margin-top: 0.45rem;
    font-size: 0.73rem;
    line-height: 1.4;
    color: #d9e3d9;
}

figcaption span { white-space: nowrap; }

/* Résumé sections */
main { padding-top: clamp(2.5rem, 5vw, 4rem); }

.overview, .entry, .skill-groups {
    display: grid;
    gap: clamp(1.5rem, 5vw, 4.5rem);
}

.overview { grid-template-columns: 1.15fr 1fr; }

.education {
    border-left: 1px solid var(--rule);
    padding-left: clamp(1.5rem, 4vw, 3.5rem);
}

.degree-date, .organization, .dates { color: var(--muted); }

.degree-date { margin-top: 0.55rem; }

main > section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--ink);
}

.entry {
    grid-template-columns: 0.9fr 1.4fr;
    padding-block: 1.3rem;
}

.entry + .entry { border-top: 1px solid var(--rule); }

.organization { margin-bottom: 0.55rem; }

.dates { font-size: 0.9rem; }

.report-link {
    display: inline-block;
    margin-top: 0.8rem;
    font-weight: 600;
}

.file-type { font-size: 0.8em; }

.skill-groups {
    grid-template-columns: 1fr 1fr;
    margin: 1.6rem 0 3rem;
}

ul { padding-left: 1.2rem; }
li + li { margin-top: 0.3rem; }
li::marker { color: #98622e; }

footer {
    border-top: 1px solid var(--rule);
    color: var(--muted);
    font-size: 0.85rem;
}

/* Stack content on smaller screens without changing its reading order. */
@media (max-width: 44rem) {
    .masthead, nav { gap: 0.75rem; }
    .masthead { flex-wrap: wrap; }
    nav { flex-wrap: wrap; }
    .intro, .overview, .entry, .skill-groups { grid-template-columns: 1fr; }
    .intro { gap: 1.65rem; }
    figure { width: min(100%, 15rem); }
    .education { padding: 1.5rem 0 0; border: 0; border-top: 1px solid var(--rule); }
    .entry { gap: 0.6rem; }
    .skill-groups { gap: 1.4rem; }
}

/* Draw the same contour texture behind the content, including the hero. */
#page-effects {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

#page-effects canvas {
    display: block;
    width: 100%;
    height: 100%;
    opacity: 0.105;
}

.warped-background:before { opacity: 0; }
.warped-background .hero { background: linear-gradient(110deg, #133a31, #214a3e); }

.masthead, .intro, main, footer {
    position: relative;
    z-index: 2;
}

.skip-link { z-index: 3; }

.typed-word { white-space: nowrap; }
.type-slot { position: relative; }
.waiting-letter { visibility: hidden; }
.typing-cursor {
    position: absolute;
    left: 0;
    bottom: 0;
    color: white;
    transform: scaleY(0.8);
    transform-origin: center 85%;
    font-style: normal;
}

.scroll-reveal {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 720ms ease-out, transform 720ms ease-out;
}

.scroll-reveal.in-view, .scroll-reveal:focus-within {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
}

@media print, (prefers-reduced-motion: reduce) {
    #page-effects { display: none; }
    .scroll-reveal { opacity: 1; transform: none; transition: none; }
}

@media print {
    .waiting-letter { visibility: visible; }
    .typing-cursor { display: none; }
}

@keyframes page-arrival {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media screen and (prefers-reduced-motion: no-preference) {
    body { animation: page-arrival 350ms ease-out; }
}

/* The compact report sits below the role on desktop and below its bullets on mobile. */
.report-entry {
    grid-template-areas: "role details" "sample details";
    grid-template-rows: auto 1fr;
    row-gap: 0.9rem;
}
.report-entry > :first-child { grid-area: role; }
.report-entry > :nth-child(2) { grid-area: details; }
.report-sample { grid-area: sample; }
.report-preview { width: min(100%, 11rem); }

.preview-strip {
    display: grid;
    grid-template-columns: 1fr minmax(0, 6rem) 1fr;
    align-items: stretch;
    padding: 3px;
    background: #eeeae0;
    border: 1px solid var(--rule);
}
.preview-strip img {
    display: block;
    grid-column: 2;
    width: 100%;
    height: auto;
    box-shadow: 0 1px 3px #173c3226;
}
.preview-strip button {
    color: var(--ink);
    background: transparent;
    border: 0;
    font-size: 1rem;
    cursor: pointer;
}
.preview-strip button:hover:enabled { background: #dfdfce; }
.preview-strip button:disabled { opacity: 0.35; cursor: default; }
.preview-strip button:focus-visible, .report-preview:focus-visible {
    outline: 2px solid var(--ink);
}
.report-preview output {
    display: block;
    text-align: center;
    color: var(--muted);
    margin-top: 0.2rem;
    font-size: 0.7rem;
}
.report-sample .report-link { margin-top: 0.25rem; font-size: 0.85rem; }

@media (max-width: 44rem) {
    .report-entry {
        grid-template-areas: "role" "details" "sample";
        grid-template-rows: auto;
    }
}
