/* ========================================
   Design System — trentgrandey.com
   Custom CSS, no frameworks
   ======================================== */

/* --- Reset & Base --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --color-bg: #fafbfc;
    --color-surface: #ffffff;
    --color-text: #1a1a2e;
    --color-text-secondary: #475569;
    --color-text-muted: #94a3b8;
    --color-accent: #2563eb;
    --color-accent-hover: #1d4ed8;
    --color-accent-subtle: #dbeafe;
    --color-border: #e2e8f0;
    --color-border-light: #f1f5f9;
    --color-tag-bg: #f1f5f9;
    --color-tag-text: #475569;
    --color-danger: #ef4444;

    --font-sans: "Inter", system-ui, -apple-system, sans-serif;
    --font-mono:
        "JetBrains Mono", "Fira Code", "Cascadia Code", "Consolas", monospace;

    --content-width: 64rem;
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md:
        0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg:
        0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);

    --transition: 150ms ease;
}

.dark {
    --color-bg: #0f172a;
    --color-surface: #1e293b;
    --color-text: #e2e8f0;
    --color-text-secondary: #94a3b8;
    --color-text-muted: #64748b;
    --color-accent: #3b82f6;
    --color-accent-hover: #60a5fa;
    --color-accent-subtle: #1e3a5f;
    --color-border: #334155;
    --color-border-light: #1e293b;
    --color-tag-bg: #334155;
    --color-tag-text: #cbd5e1;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md:
        0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
    --shadow-lg:
        0 10px 15px -3px rgba(0, 0, 0, 0.35), 0 4px 6px -4px rgba(0, 0, 0, 0.2);
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Accent bar at top of page */
body::before {
    content: "";
    display: block;
    height: 3px;
    background: linear-gradient(90deg, var(--color-accent), #8b5cf6);
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover {
    color: var(--color-accent-hover);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* --- Typography --- */
h1,
h2,
h3,
h4 {
    line-height: 1.3;
    font-weight: 600;
}
h1 {
    font-size: 2.25rem;
}
h2 {
    font-size: 1.5rem;
}
h3 {
    font-size: 1.125rem;
}

/* Terminal-style section labels */
.section-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 0.5rem;
}
.section-label::before {
    content: "// ";
    opacity: 0.5;
}

/* --- Layout --- */
.content-width {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.page-section {
    padding: 2.5rem 0;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* --- Header --- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--color-border);
    background: color-mix(in srgb, var(--color-bg) 85%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.site-header .content-width {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.site-brand {
    font-weight: 600;
    font-size: 1.125rem;
    color: var(--color-text);
    text-decoration: none;
}
.site-brand:hover {
    color: var(--color-accent);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Desktop nav */
.desktop-nav {
    display: none;
    gap: 1.5rem;
    font-size: 0.875rem;
}
.desktop-nav a {
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: color var(--transition);
    position: relative;
}
.desktop-nav a:hover,
.desktop-nav a.active {
    color: var(--color-accent);
}
.desktop-nav a.active::after {
    content: "";
    position: absolute;
    bottom: -0.85rem;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--color-accent);
    border-radius: 1px;
}

@media (min-width: 768px) {
    .desktop-nav {
        display: flex;
    }
    .mobile-toggle {
        display: none !important;
    }
}

/* Mobile nav */
.mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--color-text);
    cursor: pointer;
    transition: background var(--transition);
}
.mobile-toggle:hover {
    background: var(--color-border-light);
}

.mobile-nav {
    display: none;
    border-top: 1px solid var(--color-border);
    background: var(--color-bg);
    padding: 1rem 0;
}
.mobile-nav.open {
    display: block;
}
.mobile-nav a {
    display: block;
    padding: 0.5rem 1.5rem;
    color: var(--color-text-secondary);
    font-size: 0.875rem;
    transition:
        background var(--transition),
        color var(--transition);
    border-radius: var(--radius-sm);
}
.mobile-nav a:hover {
    background: var(--color-border-light);
    color: var(--color-accent);
}

/* Theme toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition:
        border-color var(--transition),
        color var(--transition);
    font-size: 1rem;
}
.theme-toggle:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

/* --- Footer --- */
.site-footer {
    border-top: 1px solid var(--color-border);
    padding: 1.5rem 0;
    margin-top: 3rem;
    font-size: 0.875rem;
    color: var(--color-text-muted);
}
.site-footer .content-width {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.footer-links {
    display: flex;
    gap: 1.5rem;
}
.footer-links a {
    color: var(--color-text-muted);
}
.footer-links a:hover {
    color: var(--color-accent);
}

@media (min-width: 768px) {
    .site-footer .content-width {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

/* --- Cards --- */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition:
        box-shadow var(--transition),
        transform var(--transition);
}
.card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}
.card-link:hover {
    color: inherit;
}
.card-link .card {
    transition:
        box-shadow var(--transition),
        transform var(--transition),
        border-color var(--transition);
}
.card-link:hover .card {
    box-shadow: var(--shadow-md);
    border-color: var(--color-accent);
    transform: translateY(-2px);
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition:
        background var(--transition),
        color var(--transition),
        box-shadow var(--transition);
    text-decoration: none;
    line-height: 1.4;
}
.btn-primary {
    background: var(--color-accent);
    color: #fff;
}
.btn-primary:hover {
    background: var(--color-accent-hover);
    color: #fff;
}
.btn-outline {
    background: transparent;
    color: var(--color-accent);
    border: 1px solid var(--color-accent);
}
.btn-outline:hover {
    background: var(--color-accent);
    color: #fff;
}

/* --- Tags --- */
.tag {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    background: var(--color-tag-bg);
    color: var(--color-tag-text);
    white-space: nowrap;
}

.tag-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

/* --- Quote/callout --- */
.callout {
    font-size: 1.125rem;
    font-style: italic;
    color: var(--color-text-secondary);
    border-left: 3px solid var(--color-accent);
    padding-left: 1rem;
    margin: 1rem 0;
}

/* --- Skills dots --- */
.skill-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.375rem 0;
    font-size: 0.875rem;
}
.skill-dots {
    display: flex;
    gap: 0.25rem;
}
.skill-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--color-border);
}
.skill-dot.filled {
    background: var(--color-accent);
}

/* --- Timeline --- */
.timeline {
    border-left: 2px solid var(--color-border);
    margin-left: 0.25rem;
    padding-left: 0;
    list-style: none;
}
.timeline-item {
    position: relative;
    padding-left: 1.75rem;
    padding-bottom: 2.5rem;
}
.timeline-item:last-child {
    padding-bottom: 0;
}
.timeline-item::before {
    content: "";
    position: absolute;
    left: -0.4375rem;
    top: 0.375rem;
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    background: var(--color-accent);
    border: 2px solid var(--color-bg);
}
.timeline-role {
    font-weight: 600;
    font-size: 1rem;
}
.timeline-company {
    color: var(--color-text-muted);
    font-weight: 400;
}
.timeline-meta {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-top: 0.25rem;
}
.timeline-achievements {
    list-style: disc;
    padding-left: 1.25rem;
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}
.timeline-achievements li {
    margin-bottom: 0.375rem;
    line-height: 1.5;
}

/* --- Project Cards --- */
.project-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.project-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}
.project-card h3 {
    font-weight: 600;
}
.project-card-year {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--color-text-muted);
    white-space: nowrap;
}
.project-card-tagline {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}
.project-card-summary {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}
.project-card-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-top: 0.5rem;
}
.status-badge {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
    background: var(--color-tag-bg);
    color: var(--color-text-muted);
    text-transform: lowercase;
}
.status-note {
    font-size: 0.7rem;
    color: var(--color-text-muted);
}

/* --- Project Filter --- */
.search-input {
    width: 100%;
    max-width: 20rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-family: var(--font-sans);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text);
    transition: border-color var(--transition);
}
.search-input:focus {
    outline: none;
    border-color: var(--color-accent);
}
.search-input::placeholder {
    color: var(--color-text-muted);
}

.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin: 1rem 0 1.5rem;
}
.filter-tag {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    background: transparent;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}
.filter-tag:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}
.filter-tag.active {
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
}
.filter-clear {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    border: none;
    background: var(--color-tag-bg);
    color: var(--color-text-muted);
    cursor: pointer;
}

.no-results {
    color: var(--color-text-muted);
    font-style: italic;
    padding: 2rem 0;
}

/* --- Project Detail / Prose --- */
.prose h2 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
}
.prose h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}
.prose p {
    margin-bottom: 1rem;
    color: var(--color-text-secondary);
    line-height: 1.7;
}
.prose ul,
.prose ol {
    padding-left: 1.25rem;
    margin-bottom: 1rem;
    color: var(--color-text-secondary);
}
.prose li {
    margin-bottom: 0.375rem;
    line-height: 1.6;
}
.prose strong {
    color: var(--color-text);
    font-weight: 600;
}
.prose a {
    color: var(--color-accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* --- Hero --- */
.hero {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: start;
}
.hero-title {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.25;
}
.hero-title .accent {
    color: var(--color-accent);
}
.hero-photo {
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
    max-width: 15rem;
}

@media (min-width: 768px) {
    .hero {
        grid-template-columns: 1.4fr 0.6fr;
    }
    .hero-title {
        font-size: 2.5rem;
    }
}

/* --- Bio layout --- */
.bio-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: start;
}
@media (min-width: 1024px) {
    .bio-layout {
        grid-template-columns: 1.3fr 0.7fr;
    }
}
.bio-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* --- Hire page --- */
.hire-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}
@media (min-width: 768px) {
    .hire-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
.hire-card h2 {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
}
.hire-card ul {
    list-style: disc;
    padding-left: 1.25rem;
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}
.hire-card li {
    margin-bottom: 0.375rem;
    line-height: 1.5;
}

/* --- Blank page (shouldn't hire) --- */
.blank-page {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.blank-box {
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-lg);
    padding: 3rem;
    margin: 2rem 0;
}
.blank-box p {
    font-size: 1.25rem;
    font-style: italic;
    color: var(--color-text-muted);
}

/* --- 404 --- */
.not-found {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 1rem;
}
.not-found-code {
    font-family: var(--font-mono);
    font-size: 5rem;
    font-weight: 700;
    color: var(--color-border);
    line-height: 1;
}

/* --- Utilities --- */
.text-secondary {
    color: var(--color-text-secondary);
}
.text-muted {
    color: var(--color-text-muted);
}
.text-accent {
    color: var(--color-accent);
}
.text-sm {
    font-size: 0.875rem;
}
.text-xs {
    font-size: 0.75rem;
}
.text-lg {
    font-size: 1.125rem;
}
.text-center {
    text-align: center;
}
.font-mono {
    font-family: var(--font-mono);
}
.font-semibold {
    font-weight: 600;
}
.mt-1 {
    margin-top: 0.5rem;
}
.mt-2 {
    margin-top: 1rem;
}
.mt-3 {
    margin-top: 1.5rem;
}
.mt-4 {
    margin-top: 2rem;
}
.mb-1 {
    margin-bottom: 0.5rem;
}
.mb-2 {
    margin-bottom: 1rem;
}
.mb-3 {
    margin-bottom: 1.5rem;
}
.mb-4 {
    margin-bottom: 2rem;
}
.gap-1 {
    gap: 0.5rem;
}
.gap-2 {
    gap: 1rem;
}
.gap-3 {
    gap: 1.5rem;
}
.flex {
    display: flex;
}
.flex-wrap {
    flex-wrap: wrap;
}
.flex-col {
    flex-direction: column;
}
.items-center {
    align-items: center;
}
.justify-between {
    justify-content: space-between;
}
.max-w-prose {
    max-width: 48rem;
}
.hidden {
    display: none;
}
.strike {
    text-decoration: line-through;
}

/* --- Print --- */
@media print {
    body::before {
        display: none;
    }
    .site-header,
    .site-footer,
    .theme-toggle,
    .mobile-toggle {
        display: none;
    }
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    a {
        color: inherit;
    }
    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
}
