/* Shared styles for ammerlaan.us: index.html, plus pages DocBlocks generates
   through _templates/page.html (such as resume.html).
   The palette and type follow bendyline.com so the personal site and the
   company site read as one family. Dark mode keeps the warm browns. */

:root {
    --bg: #faf8f5;
    --surface: #ffffff;
    --tint: #f3eee7;
    --ink: #2e2722;
    --ink-soft: #54483f;
    --muted: #6f635a;
    --brand: #5c4a3a;
    --brand-hover: #46372a;
    --on-brand: #ffffff;
    --sun: #eaa25e;
    --sun-soft: rgba(234, 162, 94, 0.25);
    --line: rgba(92, 74, 58, 0.16);
    --line-strong: rgba(92, 74, 58, 0.3);
    --hover-wash: rgba(92, 74, 58, 0.07);
    --shadow: 0 1px 2px rgba(58, 48, 40, 0.06), 0 10px 30px rgba(58, 48, 40, 0.08);
    --shadow-hover: 0 2px 4px rgba(58, 48, 40, 0.08), 0 16px 40px rgba(58, 48, 40, 0.14);
    --radius: 14px;
    --radius-sm: 8px;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-serif: "Iowan Old Style", "Palatino Linotype", "URW Palladio L", P052, Georgia, serif;
    --wrap: 1100px;
    --gutter: 24px;
    color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #1f1a17;
        --surface: #2b2420;
        --tint: #251f1b;
        --ink: #f3ede0;
        --ink-soft: #d9cebe;
        --muted: #a89b85;
        --brand: #e2b98f;
        --brand-hover: #f0caa3;
        --on-brand: #1f1a17;
        --sun-soft: rgba(234, 162, 94, 0.3);
        --line: rgba(243, 237, 224, 0.12);
        --line-strong: rgba(243, 237, 224, 0.24);
        --hover-wash: rgba(243, 237, 224, 0.06);
        --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.25);
        --shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.35), 0 16px 40px rgba(0, 0, 0, 0.35);
    }
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

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

a {
    color: var(--brand);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

a:hover {
    color: var(--brand-hover);
}

:focus-visible {
    outline: 3px solid var(--sun);
    outline-offset: 2px;
    border-radius: 4px;
}

h1,
h2,
h3 {
    font-family: var(--font-serif);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: var(--ink);
    margin: 0;
}

p {
    margin: 0;
}

.wrap {
    width: 100%;
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

/* ---------- Header ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: saturate(1.4) blur(10px);
    -webkit-backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--line);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1.5rem;
    min-height: 64px;
}

.site-name {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--ink);
    text-decoration: none;
    white-space: nowrap;
}

.site-name:hover {
    color: var(--brand);
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.15rem;
}

.site-nav a {
    padding: 0.4rem 0.7rem;
    border-radius: 6px;
    color: var(--ink-soft);
    font-size: 0.93rem;
    font-weight: 500;
    text-decoration: none;
}

.site-nav a:hover {
    color: var(--ink);
    background: var(--hover-wash);
}

/* ---------- Shared pieces ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.2rem;
    border: 2px solid var(--brand);
    border-radius: 6px;
    background: var(--brand);
    color: var(--on-brand);
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn:hover {
    background: var(--brand-hover);
    border-color: var(--brand-hover);
    color: var(--on-brand);
}

.btn--ghost {
    background: transparent;
    color: var(--brand);
}

.btn--ghost:hover {
    background: var(--hover-wash);
    color: var(--brand-hover);
}

.text-link {
    color: var(--brand);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 2px solid var(--sun-soft);
    transition: border-color 0.15s ease;
}

.text-link:hover {
    border-bottom-color: var(--sun);
}

.section {
    padding: 88px 0;
}

.section--tint {
    background: var(--tint);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.section-head {
    max-width: 700px;
    margin-bottom: 2.5rem;
}

.section-head h2 {
    font-size: clamp(1.8rem, 3.4vw, 2.5rem);
    margin-bottom: 0.75rem;
}

.section-head p {
    font-size: 1.08rem;
    color: var(--ink-soft);
}

.section-head--row {
    max-width: none;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.25rem 2rem;
}

.section-head--row > div {
    max-width: 700px;
}

.section-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 1.5rem;
    margin-top: 2.5rem;
}

.card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

/* Make a whole card clickable from the one real link inside it. */
.card .stretched::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
}

/* ---------- Hero ---------- */

.hero {
    padding: 72px 0 80px;
}

.hero__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
    gap: 3.5rem;
    align-items: center;
}

.hero h1 {
    font-size: clamp(2.6rem, 6vw, 4rem);
    margin-bottom: 1rem;
}

.hero__tagline {
    font-family: var(--font-serif);
    font-size: clamp(1.3rem, 2.4vw, 1.6rem);
    line-height: 1.35;
    color: var(--ink);
    margin-bottom: 1.25rem;
}

.hero__lead {
    font-size: 1.1rem;
    color: var(--ink-soft);
    max-width: 38em;
    margin-bottom: 2rem;
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.75rem;
}

.social {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.social a {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--ink-soft);
    font-size: 0.93rem;
    text-decoration: none;
}

.social a:hover {
    color: var(--brand);
}

.social i {
    width: 1.1em;
    text-align: center;
    color: var(--muted);
}

.social a:hover i {
    color: var(--brand);
}

.hero__photo {
    margin: 0;
    justify-self: center;
    max-width: 380px;
}

.hero__photo img {
    border-radius: var(--radius);
    box-shadow: var(--shadow-hover);
    transform: rotate(1.5deg);
    border: 6px solid var(--surface);
}

.hero__photo figcaption {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--muted);
    text-align: center;
    font-style: italic;
}

/* ---------- Bendyline ---------- */

.brand-head {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 2.5rem;
    align-items: center;
    max-width: 920px;
}

.brand-head .wordmark img {
    width: 200px;
}

@media (prefers-color-scheme: dark) {
    /* The wordmark is dark brown on transparent; flip its lightness and keep its hue. */
    .brand-head .wordmark img {
        filter: invert(1) hue-rotate(180deg) brightness(0.95);
    }
}

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

.product {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.product__shot {
    aspect-ratio: 16 / 10;
    overflow: hidden; /* lets aspect-ratio win over the image's own proportions */
    border-bottom: 1px solid var(--line);
    background: var(--tint);
}

.product__shot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top left;
}

.product__body {
    padding: 1.4rem 1.5rem 1.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    flex: 1;
}

.product__meta {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.product h3 {
    font-size: 1.55rem;
}

.product h3 a {
    color: var(--ink);
    text-decoration: none;
}

.product__line {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    color: var(--ink);
}

.product__desc {
    color: var(--ink-soft);
    font-size: 0.97rem;
}

.product__url {
    margin-top: auto;
    padding-top: 0.4rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--brand);
}

.subhead {
    font-size: 1.35rem;
    margin: 3.5rem 0 1.25rem;
}

.foundations {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.foundation {
    padding: 1.15rem 1.3rem;
}

.foundation h4 {
    margin: 0 0 0.3rem;
    font-size: 1.02rem;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
}

.foundation h4 a {
    color: var(--ink);
    text-decoration: none;
}

.foundation__tag {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--muted);
    white-space: nowrap;
}

.foundation p {
    font-size: 0.93rem;
    color: var(--ink-soft);
}

/* ---------- Writing ---------- */

.posts {
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--line);
}

.post {
    border-bottom: 1px solid var(--line);
}

.post a {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.25rem 2rem;
    align-items: center;
    padding: 1.4rem 1rem;
    margin: 0 -1rem;
    border-radius: var(--radius-sm);
    color: inherit;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.post a:hover {
    background: var(--hover-wash);
}

.post__date {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.25rem;
}

.post__title {
    display: block;
    font-family: var(--font-serif);
    font-size: 1.3rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--ink);
}

.post a:hover .post__title {
    color: var(--brand);
}

.post__summary {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    margin-top: 0.35rem;
    color: var(--ink-soft);
    font-size: 0.97rem;
    max-width: 52em;
}

.post__arrow {
    font-size: 1.2rem;
    color: var(--muted);
    transition: transform 0.15s ease, color 0.15s ease;
}

.post a:hover .post__arrow {
    color: var(--brand);
    transform: translateX(3px);
}

/* ---------- Videos ---------- */

.videos {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.video {
    overflow: hidden;
}

.video__thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #000;
}

.video__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video__play {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 56px;
    height: 56px;
    margin: -28px 0 0 -28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(31, 26, 23, 0.72);
    color: #fff;
    font-size: 1.1rem;
    padding-left: 3px;
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.video:hover .video__play {
    background: #c4302b;
    transform: scale(1.06);
}

.video__body {
    padding: 1rem 1.2rem 1.2rem;
}

.video__title {
    font-family: var(--font-serif);
    font-size: 1.12rem;
    font-weight: 600;
    line-height: 1.3;
}

.video__title a {
    color: var(--ink);
    text-decoration: none;
}

/* ---------- Background (career) ---------- */

.timeline {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0;
}

.timeline__item {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 0.5rem 2.5rem;
    padding: 1.75rem 0;
    border-top: 1px solid var(--line);
}

.timeline__item:last-child {
    border-bottom: 1px solid var(--line);
}

.timeline__org {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    padding-top: 0.3rem;
}

.timeline__item h3 {
    font-size: 1.3rem;
    margin-bottom: 0.6rem;
}

.timeline__item ul {
    margin: 0;
    padding-left: 1.15rem;
    color: var(--ink-soft);
}

.timeline__item li + li {
    margin-top: 0.4rem;
}

.timeline__item li::marker {
    color: var(--sun);
}

/* ---------- Off the clock ---------- */

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

.personal__card {
    padding: 1.5rem 1.6rem 1.6rem;
}

.personal__card:hover {
    transform: none;
    box-shadow: var(--shadow);
}

.personal__icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin-bottom: 1rem;
    border-radius: 50%;
    background: var(--sun-soft);
    color: var(--brand);
    font-size: 1.1rem;
}

.personal__card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.personal__card p {
    color: var(--ink-soft);
}

.personal__card ul {
    margin: 0.5rem 0 0;
    padding-left: 1.15rem;
    color: var(--ink-soft);
}

/* ---------- Contact + footer ---------- */

.contact {
    text-align: center;
}

.contact p {
    font-size: 1.1rem;
    color: var(--ink-soft);
    max-width: 34em;
    margin: 0 auto 1.75rem;
}

.contact .hero__actions {
    justify-content: center;
    margin-bottom: 0;
}

.site-footer {
    border-top: 1px solid var(--line);
    padding: 1.75rem 0 2.25rem;
    font-size: 0.9rem;
    color: var(--muted);
}

.site-footer .wrap {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem 1.5rem;
}

.site-footer a {
    color: var(--muted);
}

.site-footer a:hover {
    color: var(--brand);
}

/* ---------- Resume (prose page) ---------- */

.prose {
    max-width: 780px;
    margin: 0 auto;
    padding: 56px var(--gutter) 80px;
}

.prose h1 {
    font-size: clamp(2.2rem, 5vw, 3rem);
    margin-bottom: 0.4rem;
}

.prose h1 + p {
    font-size: 1.1rem;
    color: var(--ink-soft);
    margin-bottom: 1rem;
}

.prose h2 {
    font-size: 1.5rem;
    margin: 2.75rem 0 1rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--line);
}

.prose p {
    margin: 0.6rem 0;
}

/* DocBlocks generates this markup from Markdown, so these rules key off
   structure rather than classes. A role line is a <p> led by a <strong> and
   followed by another <p> (its dates); "Focus:"-style lines, followed by a
   heading, are left alone. */
.prose p:has(> strong:only-child):has(+ p) {
    margin-top: 1.75rem;
    margin-bottom: 0;
    font-size: 1.05rem;
}

.prose p:has(> strong:only-child):has(+ p) + p {
    margin-top: 0.1rem;
    font-size: 0.9rem;
    color: var(--muted);
}

/* The links list right under the page title reads as one inline row. */
.prose > h1 + p + ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.25rem;
    padding: 0;
    list-style: none;
}

.prose > h1 + p + ul p {
    margin: 0;
}

.prose ul {
    padding-left: 1.2rem;
    color: var(--ink-soft);
}

.prose li p {
    margin: 0.35rem 0;
}

.prose li ul {
    margin: 0.25rem 0 0.5rem;
}

.prose li::marker {
    color: var(--sun);
}

.prose code {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.9em;
    background: var(--tint);
    padding: 0.1em 0.35em;
    border-radius: 4px;
}

.prose pre {
    background: var(--tint);
    padding: 1rem 1.2rem;
    border-radius: var(--radius-sm);
    overflow-x: auto;
}

.prose pre code {
    background: none;
    padding: 0;
}

.resume-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.25rem;
}

.resume-links p {
    margin: 0;
}

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
    /* Tablet: products become wide horizontal cards rather than a cramped row of three. */
    .products {
        grid-template-columns: minmax(0, 1fr);
    }

    .product {
        flex-direction: row;
    }

    .product__shot {
        flex: 0 0 44%;
        aspect-ratio: auto;
        border-bottom: 0;
        border-right: 1px solid var(--line);
    }

    .videos,
    .personal {
        gap: 1rem;
    }

    .timeline__item {
        grid-template-columns: 170px minmax(0, 1fr);
        gap: 0.5rem 1.75rem;
    }
}

@media (max-width: 760px) {
    :root {
        --gutter: 16px;
    }

    .site-header {
        position: static;
    }

    .header-inner {
        flex-direction: column;
        align-items: flex-start;
        padding-top: 0.75rem;
        padding-bottom: 0.5rem;
    }

    .site-nav {
        margin-left: -0.5rem;
        gap: 0;
    }

    .site-nav a {
        padding: 0.4rem 0.5rem;
    }

    .section {
        padding: 64px 0;
    }

    .hero {
        padding: 32px 0 56px;
    }

    .hero__grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 2rem;
    }

    .hero__photo {
        order: -1;
        max-width: 100%;
        width: 100%;
    }

    .hero__photo img {
        transform: none;
        aspect-ratio: 1 / 1;
        object-fit: cover;
        object-position: 50% 88%;
        width: 100%;
    }

    .brand-head {
        grid-template-columns: minmax(0, 1fr);
        gap: 1.25rem;
    }

    .brand-head .wordmark img {
        width: 150px;
    }

    .videos,
    .personal,
    .foundations {
        grid-template-columns: minmax(0, 1fr);
    }

    .product {
        flex-direction: column;
    }

    .product__shot {
        flex: none;
        aspect-ratio: 16 / 10;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

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

    .post a {
        grid-template-columns: minmax(0, 1fr);
    }

    .post__arrow {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition: none !important;
    }

    .card:hover {
        transform: none;
    }
}

@media print {
    .site-header,
    .site-footer {
        display: none;
    }

    :root {
        --bg: #fff;
        --ink: #000;
        --ink-soft: #222;
        --muted: #555;
        --brand: #000;
    }

    .prose {
        padding: 0;
        max-width: none;
    }
}
