/* ==========================================================================
   pages.css — shared styles for resume.html and contact.html
   Extends global.css. Design language taken from the existing pages:
   cream ground, sage pills, deep green ink, Lato.
   ========================================================================== */

:root {
    /* Surfaces */
    --cream: #F5F4EB;
    --sage: #D2E3C8;
    --sage-soft: #E4EFDD;

    /* Ink — deep is reserved for text sitting on sage (AA at 5.7:1);
       brand sits on cream (5.1:1). */
    --ink: #4F6F52;
    --ink-deep: #3E5941;
    --ink-muted: #6C8A6F;

    /* Lines & accents */
    --rule: #9FBBA2;
    --rule-soft: #C9DBC4;
    --hover: #A0C9A4;

    /* Fluid type scale */
    --text-xs: clamp(0.75rem, 0.73rem + 0.1vw, 0.8125rem);
    --text-sm: clamp(0.875rem, 0.85rem + 0.12vw, 0.9375rem);
    --text-base: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
    --text-lg: clamp(1.125rem, 1.05rem + 0.35vw, 1.375rem);
    --text-xl: clamp(1.5rem, 1.3rem + 1vw, 2rem);
    --text-display: clamp(2.25rem, 1.6rem + 3.2vw, 4rem);

    /* Rhythm */
    --gap: clamp(1rem, 0.8rem + 1vw, 1.75rem);
    --section-gap: clamp(2.5rem, 2rem + 1.8vw, 3.75rem);
    --radius: 28px;
    --radius-pill: 999px;
}

/* --------------------------------------------------------------------------
   Shell
   -------------------------------------------------------------------------- */

body {
    color: var(--ink);
    background: var(--cream);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* global.css sets `main { width: 80% }` — too narrow for reading on laptops
   and too wide on ultrawides. Override with a measured column. */
.page-main {
    width: min(100% - 2.5rem, 68rem);
    margin-inline: auto;
    padding-top: clamp(7rem, 6rem + 4vw, 9rem);
}

/* Skip link — first tab stop, invisible until focused. */
.skip-link {
    position: absolute;
    left: 50%;
    translate: -50% -150%;
    z-index: 30;
    padding: 0.75rem 1.5rem;
    background: var(--ink);
    color: var(--cream);
    border-radius: 0 0 var(--radius-pill) var(--radius-pill);
    text-decoration: none;
    font-weight: 700;
    transition: translate 0.2s ease;
}

.skip-link:focus-visible {
    translate: -50% 0;
}

/* One consistent focus ring across both pages. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
summary:focus-visible {
    outline: 3px solid var(--ink);
    outline-offset: 3px;
    border-radius: 4px;
}

/* --------------------------------------------------------------------------
   Page head — shared by both pages
   -------------------------------------------------------------------------- */

.page-head {
    padding-block-end: clamp(1rem, 0.5rem + 1vw, 1.5rem);
}

.eyebrow {
    display: inline-block;
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-muted);
    margin-block-end: 1rem;
}

.page-head h1 {
    font-size: var(--text-display);
    font-weight: 900;
    line-height: 1.02;
    letter-spacing: -0.02em;
    max-width: 18ch;
    margin-block-end: 1.25rem;
}

.page-head .lede {
    font-size: var(--text-lg);
    max-width: 52ch;
    color: var(--ink);
    line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Signature: the annotation rail.
   Section labels pin in the left margin beside their content, the way a
   designer annotates a wireframe. Collapses to a stacked heading on narrow
   screens where a margin does not exist.
   -------------------------------------------------------------------------- */

/* The hairline above each section is the same device the existing hero
   sections use (border-bottom: #9fbba2 1px), carried through the whole page
   so the sections read as one ruled document. */
.rail,
.contact-grid {
    border-block-start: 1px solid var(--rule);
}

.rail {
    display: grid;
    grid-template-columns: minmax(0, 10rem) minmax(0, 1fr);
    gap: clamp(1.25rem, 0.75rem + 2.5vw, 3.5rem);
    padding-block-start: clamp(1.75rem, 1.25rem + 1.5vw, 2.75rem);
    margin-block-start: var(--section-gap);
}

.rail-label {
    position: sticky;
    top: 8.5rem;
    align-self: start;
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-muted);
    padding-block-start: 0.35rem;
}

.rail-body > * + * {
    margin-block-start: var(--gap);
}

@media (max-width: 820px) {
    .rail {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .rail-label {
        position: static;
    }
}

/* --------------------------------------------------------------------------
   Entries — education and experience rows
   -------------------------------------------------------------------------- */

.entry {
    padding-block: 1.5rem;
    border-block-end: 1px solid var(--rule-soft);
}

/* The rail already supplies the space above the first entry, so its own
   padding would double it and push the title out of line with the label. */
.entry:first-child {
    padding-block-start: 0;
}

.entry:last-child {
    border-block-end: 0;
    padding-block-end: 0;
}

.entry-top {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem 1rem;
}

.entry h3 {
    font-size: var(--text-lg);
    font-weight: 700;
    line-height: 1.25;
}

/* Dates are data, not prose — set them apart with tracking, not weight. */
.entry-date {
    font-size: var(--text-sm);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
    color: var(--ink-muted);
    white-space: nowrap;
}

.entry-org {
    display: block;
    font-size: var(--text-base);
    color: var(--ink-muted);
    margin-block-start: 0.15rem;
}

.entry p {
    font-size: var(--text-base);
    max-width: 62ch;
    margin-block-start: 0.75rem;
}

.entry ul {
    margin-block-start: 0.75rem;
    padding-inline-start: 1.1rem;
    max-width: 62ch;
}

.entry li {
    font-size: var(--text-base);
    margin-block-start: 0.4rem;
}

.entry li::marker {
    color: var(--rule);
}

/* --------------------------------------------------------------------------
   Skill pills — the pill is already this site's signature shape
   (nav, buttons, social links), so skills extend it rather than import
   a new device. No proficiency bars: they imply a precision nobody can back up.
   -------------------------------------------------------------------------- */

.skill-group + .skill-group {
    margin-block-start: 1.75rem;
}

.skill-group h3 {
    font-size: var(--text-sm);
    font-weight: 700;
    letter-spacing: 0.06em;
    margin-block-end: 0.85rem;
}

.pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
}

.pills li {
    padding: 0.5rem 1.1rem;
    background: var(--sage);
    color: var(--ink-deep);
    border-radius: var(--radius-pill);
    font-size: var(--text-sm);
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   Actions
   -------------------------------------------------------------------------- */

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-block-start: 2rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 48px;
    padding: 0.75rem 1.75rem;
    border-radius: var(--radius-pill);
    border: 1px solid transparent;
    font-size: var(--text-base);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn-primary {
    background: var(--ink);
    color: var(--cream);
}

.btn-primary:hover {
    background: var(--ink-deep);
}

.btn-secondary {
    background: transparent;
    color: var(--ink);
    border-color: var(--rule);
}

.btn-secondary:hover {
    background: var(--sage-soft);
    border-color: var(--ink);
}

/* --------------------------------------------------------------------------
   Contact page — two panels
   -------------------------------------------------------------------------- */

.contact-grid {
    display: grid;
    grid-template-columns: minmax(0, 20rem) minmax(0, 1fr);
    gap: clamp(2rem, 1rem + 4vw, 4.5rem);
    padding-block-start: clamp(1.75rem, 1.25rem + 1.5vw, 2.75rem);
    margin-block-start: var(--section-gap);
    align-items: start;
}

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

.contact-aside > * + * {
    margin-block-start: 2.25rem;
}

.aside-block h2 {
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-muted);
    margin-block-end: 0.9rem;
}

.direct-link {
    display: inline-block;
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--ink);
    text-decoration: none;
    border-block-end: 2px solid var(--rule);
    padding-block-end: 2px;
    transition: border-color 0.2s ease, color 0.2s ease;
    overflow-wrap: anywhere;
}

.direct-link:hover {
    color: var(--ink-deep);
    border-block-end-color: var(--ink);
}

/* Two places is the most specific fact about this designer, so it is
   given real estate and made useful: where, and when to expect a reply. */
.places {
    display: grid;
    gap: 0.75rem;
    list-style: none;
    padding: 0;
}

.place {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    background: var(--sage-soft);
    border-radius: var(--radius);
    border: 1px solid var(--rule-soft);
}

.place-name {
    font-weight: 700;
    color: var(--ink-deep);
}

.place-zone {
    font-size: var(--text-sm);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
    color: var(--ink-muted);
    white-space: nowrap;
}

.reply-note {
    font-size: var(--text-sm);
    color: var(--ink-muted);
    margin-block-start: 0.85rem;
    max-width: 34ch;
}

/* --------------------------------------------------------------------------
   Form
   -------------------------------------------------------------------------- */

.form-card {
    background: var(--cream);
    border: 1px solid var(--rule-soft);
    border-radius: var(--radius);
    padding: clamp(1.5rem, 1rem + 2vw, 2.5rem);
}

.form-card h2 {
    font-size: var(--text-xl);
    font-weight: 900;
    letter-spacing: -0.01em;
    margin-block-end: 0.5rem;
}

.form-intro {
    font-size: var(--text-base);
    color: var(--ink-muted);
    max-width: 46ch;
    margin-block-end: 1.75rem;
}

.field + .field {
    margin-block-start: 1.5rem;
}

/* Label sits closer to its own input than to the next group — proximity
   does the grouping so no boxes are needed. */
.field label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 700;
    margin-block-end: 0.4rem;
}

.optional {
    font-weight: 400;
    color: var(--ink-muted);
}

.hint {
    display: block;
    font-size: var(--text-sm);
    color: var(--ink-muted);
    margin-block-end: 0.5rem;
}

.field input,
.field textarea {
    width: 100%;
    min-height: 48px;
    padding: 0.85rem 1rem;
    /* 1rem minimum stops iOS Safari zooming on focus. */
    font-size: max(1rem, var(--text-base));
    font-family: inherit;
    color: var(--ink);
    background: #FFFDF7;
    border: 1px solid var(--rule);
    border-radius: 18px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field textarea {
    min-height: 10rem;
    resize: vertical;
    line-height: 1.6;
}

.field input::placeholder,
.field textarea::placeholder {
    color: #8FA891;
}

.field input:focus-visible,
.field textarea:focus-visible {
    outline: 3px solid var(--ink);
    outline-offset: 2px;
    border-color: var(--ink);
}

/* Validation only after the field has been interacted with and left —
   :user-invalid never fires on load or mid-typing, unlike :invalid. */
.field input:user-invalid,
.field textarea:user-invalid {
    border-color: #B3261E;
    box-shadow: 0 0 0 1px #B3261E;
}

/* Hidden by default and revealed only when the matching input is
   :user-invalid, so the message and the border state can never disagree.
   Stated in this direction on purpose: if :has() is unsupported the rule is
   dropped and the messages stay hidden, rather than every field showing an
   error on load. Meaning never rests on colour alone — the text carries it. */
.field-error {
    display: none;
    font-size: var(--text-sm);
    font-weight: 600;
    color: #8C1D18;
    margin-block-start: 0.45rem;
}

.field:has(:user-invalid) .field-error {
    display: block;
}

.form-status {
    margin-block-start: 1.25rem;
    padding: 0.9rem 1.25rem;
    background: var(--sage);
    color: var(--ink-deep);
    border-radius: var(--radius);
    font-weight: 600;
}

.form-status:empty {
    display: none;
}

.form-card .btn {
    margin-block-start: 1.75rem;
    width: 100%;
    justify-content: center;
}

@media (min-width: 560px) {
    .form-card .btn {
        width: auto;
    }
}

/* --------------------------------------------------------------------------
   Motion & print
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* A resume is a document before it is a web page: make Save as PDF produce
   something worth attaching to an application. */
@media print {
    .header,
    .skip-link,
    .actions,
    footer {
        display: none !important;
    }

    body {
        background: #fff;
        color: #000;
    }

    .page-main {
        width: 100%;
        padding-top: 0;
    }

    .rail {
        grid-template-columns: 9rem 1fr;
        padding-block-start: 1.5rem;
        break-inside: avoid;
    }

    .rail-label {
        position: static;
    }

    .entry {
        break-inside: avoid;
    }

    .pills li {
        border: 1px solid #666;
        background: none;
        color: #000;
    }

    a {
        text-decoration: underline;
    }
}
