/* ==========================================================================
   kyletebo.com — design system
   Direction: "Warm editorial, evolved"

   Two accents, two jobs:
     --clay  is the ACTION color  (links, buttons, active nav). Used once
             per viewport as a call to action; it never decorates.
     --sage  is the STRUCTURE color (eyebrows, borders, bullets, tags).
             It organizes; it never asks for a click.

   Type roles:
     Fraunces   — display (headings)
     Newsreader — body / longform
     system sans — UI chrome (nav, buttons, dates, labels, tags)

   Spacing snaps to: 4 / 8 / 12 / 16 / 24 / 32 / 48 / 64 / 96px.
   ========================================================================== */

:root {
    /* neutrals */
    --ground: #f7f3ea;
    --surface: #fffdf8;
    --ink: #2b2b28;
    --ink-soft: #5c574c;
    --muted: #87816f;
    --hairline: #ddd4c0;
    --hairline-soft: #e9e2d2;
    --shadow: rgba(90, 70, 50, 0.10);

    /* accents */
    --sage: #8a9a7e;
    --sage-deep: #5f7355;
    --clay: #b5613f;
    --clay-deep: #96492c;
    --on-clay: #fdf8ef;

    /* type */
    --font-display: 'Fraunces', Georgia, serif;
    --font-body: 'Newsreader', Georgia, serif;
    --font-ui: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;

    /* layout */
    --container: 1100px;
    --measure: 68ch;
    --radius: 2px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --ground: #211f1a;
        --surface: #2a2822;
        --ink: #ece7da;
        --ink-soft: #c0b9a8;
        --muted: #948d7b;
        --hairline: #3d3a30;
        --hairline-soft: #353228;
        --shadow: rgba(0, 0, 0, 0.35);
        --sage: #9db08c;
        --sage-deep: #b3c4a3;
        --clay: #cf7a52;
        --clay-deep: #dd9270;
        --on-clay: #211f1a;
    }
}

/* ------------------------------------------------------------------ base */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 1.06rem;
    line-height: 1.7;
    color: var(--ink);
    background-color: var(--ground);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    color: var(--ink);
    line-height: 1.15;
    text-wrap: balance;
}

a {
    color: var(--clay);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--clay-deep);
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--clay);
    outline-offset: 3px;
}

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

::selection {
    background: var(--sage);
    color: var(--surface);
}

/* shared small-caps label */
.eyebrow {
    font-family: var(--font-ui);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--sage-deep);
}

/* ------------------------------------------------------------------- nav */

.navbar {
    background-color: var(--surface);
    border-bottom: 1px solid var(--hairline-soft);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.nav-logo {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--clay);
}

.nav-logo:hover {
    color: var(--clay-deep);
}

.nav-menu {
    list-style: none;
    display: flex;
    gap: 32px;
}

.nav-menu a {
    font-family: var(--font-ui);
    font-size: 0.85rem;
    color: var(--ink-soft);
    padding-bottom: 4px;
    border-bottom: 1px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.nav-menu a:hover {
    color: var(--ink);
}

.nav-menu a.active {
    color: var(--ink);
    border-bottom-color: var(--clay);
}

/* ------------------------------------------------------------------ page */

.container {
    flex: 1;
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 48px 24px 96px;
    animation: page-in 0.45s ease both;
}

@keyframes page-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}

.page-header {
    margin-bottom: 48px;
}

.page-header .eyebrow {
    margin-bottom: 12px;
}

.page-title {
    font-size: 2.4rem;
    font-weight: 500;
    margin-bottom: 12px;
}

.page-lede {
    font-size: 1.1rem;
    color: var(--ink-soft);
    max-width: var(--measure);
}

/* ------------------------------------------------------------------ hero */

.hero {
    padding: 48px 0 64px;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 48px;
    align-items: center;
}

.hero .eyebrow {
    margin-bottom: 16px;
}

.hero-title {
    font-size: 3.2rem;
    font-weight: 500;
    margin-bottom: 24px;
}

.bio {
    color: var(--ink-soft);
    max-width: var(--measure);
    margin-bottom: 32px;
}

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

.headshot-container {
    display: flex;
    justify-content: center;
}

.headshot {
    width: 240px;
    height: 240px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--clay);
    box-shadow: 0 12px 30px var(--shadow);
}

/* --------------------------------------------------------------- buttons */

.btn {
    display: inline-block;
    font-family: var(--font-ui);
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    padding: 12px 26px;
    border-radius: var(--radius);
    background-color: var(--clay);
    color: var(--on-clay);
    border: 1px solid var(--clay);
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

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

.btn-ghost {
    background-color: transparent;
    color: var(--sage-deep);
    border-color: var(--sage);
}

.btn-ghost:hover {
    background-color: var(--sage);
    border-color: var(--sage);
    color: var(--surface);
}

/* ------------------------------------------------------------ post cards */

.latest-writing {
    padding-bottom: 64px;
}

.latest-writing .eyebrow {
    margin-bottom: 16px;
}

.post-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.callout-link {
    display: block;
    background-color: var(--surface);
    border-left: 3px solid var(--sage);
    border-radius: var(--radius);
    padding: 20px 28px;
    margin-bottom: 40px;
    max-width: 44em;
    box-shadow: 0 1px 6px var(--shadow);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.callout-link:hover {
    box-shadow: 0 6px 18px var(--shadow);
    transform: translateY(-2px);
}

.callout-link .eyebrow {
    display: block;
    margin-bottom: 6px;
}

.callout-link .callout-text {
    font-family: var(--font-body);
    font-size: 1.05rem;
    color: var(--clay);
}

.callout-link:hover .callout-text {
    color: var(--clay-deep);
}

.post-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 44em;
}

.post-card {
    background-color: var(--surface);
    border-left: 3px solid var(--sage);
    border-radius: var(--radius);
    padding: 24px 28px;
    box-shadow: 0 1px 6px var(--shadow);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

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

.post-card-title {
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.post-card-title a {
    color: var(--ink);
}

.post-card-title a:hover {
    color: var(--clay);
}

.post-meta {
    font-family: var(--font-ui);
    font-size: 0.75rem;
    color: var(--muted);
    margin-bottom: 12px;
}

.post-excerpt {
    color: var(--ink-soft);
    font-size: 0.98rem;
    margin-bottom: 12px;
}

.read-more {
    font-family: var(--font-ui);
    font-size: 0.82rem;
}

/* ------------------------------------------------------------- post page */

.post {
    max-width: var(--measure);
    margin: 0 auto;
}

.post-header {
    margin-bottom: 32px;
}

.post-header .eyebrow {
    margin-bottom: 12px;
}

.post-title {
    font-size: 2.4rem;
    font-weight: 500;
}

.post-body p {
    margin-bottom: 24px;
    color: var(--ink-soft);
}

.post-body h2 {
    font-size: 1.6rem;
    font-weight: 500;
    margin: 48px 0 16px;
}

.post-body h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 32px 0 12px;
}

.post-body ul,
.post-body ol {
    margin: 0 0 24px 1.4em;
    color: var(--ink-soft);
}

.post-body li {
    margin-bottom: 8px;
}

.post-body li::marker {
    color: var(--sage);
}

.post-body blockquote {
    border-left: 3px solid var(--sage);
    padding: 4px 0 4px 24px;
    margin: 0 0 24px;
    font-style: italic;
    color: var(--ink-soft);
}

.post-body img {
    border-radius: var(--radius);
    margin: 8px 0 24px;
}

.post-body code {
    font-family: ui-monospace, 'SF Mono', Menlo, monospace;
    font-size: 0.85em;
    background-color: var(--surface);
    border: 1px solid var(--hairline-soft);
    border-radius: var(--radius);
    padding: 2px 6px;
}

.post-body pre {
    background-color: var(--surface);
    border: 1px solid var(--hairline-soft);
    border-radius: var(--radius);
    padding: 16px 20px;
    overflow-x: auto;
    margin-bottom: 24px;
}

.post-body pre code {
    border: none;
    padding: 0;
    background: none;
}

.post-footer {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--hairline);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    font-family: var(--font-ui);
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    color: var(--sage-deep);
    border: 1px solid var(--sage);
    border-radius: 999px;
    padding: 4px 12px;
}

.back-link {
    font-family: var(--font-ui);
    font-size: 0.82rem;
}

/* -------------------------------------------------------------------- cv */

.cv-container {
    max-width: var(--measure);
}

.cv-section {
    margin-bottom: 48px;
}

.cv-section h2 {
    font-size: 1.75rem;
    font-weight: 500;
    margin-bottom: 24px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--hairline);
}

.cv-item {
    margin-bottom: 32px;
}

.cv-item:last-child {
    margin-bottom: 0;
}

.cv-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 16px;
}

.cv-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.cv-header .date {
    font-family: var(--font-ui);
    font-size: 0.78rem;
    color: var(--muted);
    white-space: nowrap;
}

.company {
    font-style: italic;
    color: var(--sage-deep);
    margin: 2px 0 8px;
}

.description {
    color: var(--ink-soft);
    font-size: 0.98rem;
}

.cv-bullets {
    list-style: none;
    margin-top: 8px;
}

.cv-bullets li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 8px;
    color: var(--ink-soft);
    font-size: 0.98rem;
}

.cv-bullets li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.6em;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--sage);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
}

.skill-category h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.skill-category ul {
    list-style: none;
}

.skill-category li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 8px;
    color: var(--ink-soft);
    font-size: 0.98rem;
}

.skill-category li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.6em;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--sage);
}

/* ------------------------------------------------------------------ form */

.contact-section {
    max-width: 32em;
    padding-top: 24px;
}

.contact-section h2 {
    font-size: 1.75rem;
    font-weight: 500;
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-family: var(--font-ui);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 6px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 11px 14px;
    font-family: var(--font-body);
    font-size: 0.98rem;
    color: var(--ink);
    background-color: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group textarea {
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--sage-deep);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--sage) 25%, transparent);
}

/* ---------------------------------------------------------------- footer */

.site-footer {
    background-color: var(--surface);
    border-top: 1px solid var(--hairline-soft);
}

.footer-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    font-family: var(--font-ui);
    font-size: 0.8rem;
    color: var(--muted);
}

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

.footer-rss:hover {
    color: var(--clay);
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 960px) {
    .hero-title {
        font-size: 2.6rem;
    }

    .hero-content {
        grid-template-columns: 1fr 220px;
        gap: 32px;
    }
}

@media (max-width: 640px) {
    body {
        font-size: 1rem;
    }

    .container {
        padding: 32px 18px 64px;
    }

    .nav-inner {
        flex-direction: column;
        gap: 12px;
        padding: 16px 18px;
    }

    .nav-menu {
        gap: 24px;
    }

    .hero {
        padding: 24px 0 48px;
    }

    .hero-content {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .headshot-container {
        order: -1;
    }

    .headshot {
        width: 180px;
        height: 180px;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .page-title,
    .post-title {
        font-size: 1.9rem;
    }

    .post-grid {
        grid-template-columns: 1fr;
    }

    .post-card {
        padding: 20px;
    }

    .footer-inner {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}

/* --------------------------------------------------------------- motion */

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

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