/* ============================================
   KEVIN BYRON CLARK | PORTFOLIO
   Paper & Ink design, ported from the Lovable build.
   ============================================ */

@font-face {
    font-family: 'DM Sans';
    font-style: normal;
    font-weight: 100 1000;
    font-display: swap;
    src: url('fonts/dm-sans-latin-wght.woff2') format('woff2');
}

@font-face {
    font-family: 'Space Grotesk';
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url('fonts/space-grotesk-latin-wght.woff2') format('woff2');
}

:root {
    --background: oklch(0.966 0.007 85);
    --foreground: oklch(0.17 0 0);
    --card: oklch(0.985 0.004 85);
    --muted: oklch(0.92 0.01 80);
    --muted-foreground: oklch(0.45 0.005 80);
    --border: oklch(0.87 0.01 80);
    --font-sans: 'DM Sans', ui-sans-serif, system-ui, sans-serif;
    --font-display: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
    --max: 72rem;
    --gutter: 1.25rem;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; border: 0 solid var(--border); }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    background-color: var(--background);
    color: var(--foreground);
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

img, video, svg { display: block; max-width: 100%; }
img, video { height: auto; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font: inherit; color: inherit; background: none; cursor: pointer; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.02em; }

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

.icon { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

.label {
    font-size: 0.75rem;
    line-height: 1rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--muted-foreground);
    font-family: var(--font-sans);
}

.muted { color: var(--muted-foreground); }

.skip-link {
    position: fixed; top: -4rem; left: 1rem; z-index: 100;
    background: var(--foreground); color: var(--background);
    padding: 0.5rem 1rem; font-size: 0.875rem;
}
.skip-link:focus { top: 1rem; }

:focus-visible { outline: 2px solid var(--foreground); outline-offset: 3px; }

/* ---------- Header ---------- */
.site-nav {
    position: sticky; top: 0; z-index: 40;
    border-bottom-width: 1px;
    background: color-mix(in oklch, var(--background) 90%, transparent);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding-top: 1rem; padding-bottom: 1rem; }
.site-nav-name { font-family: var(--font-display); font-size: 1rem; font-weight: 600; letter-spacing: -0.025em; }
.site-nav-links { display: flex; gap: 1.5rem; font-size: 0.875rem; color: var(--muted-foreground); }
.site-nav-links a { padding: 0.25rem 0; }
.site-nav-links a:hover { color: var(--foreground); }

/* ---------- Hero ---------- */
.hero { padding-top: 5rem; padding-bottom: 3rem; }
.hero-title { margin-top: 1.25rem; max-width: 56rem; font-size: 2.25rem; line-height: 1.05; }
.hero-sub { margin-top: 1.5rem; max-width: 42rem; font-size: 1.125rem; line-height: 1.75rem; color: var(--muted-foreground); }
.hero-actions { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 0.75rem; font-size: 0.875rem; }

.btn { display: inline-block; padding: 0.75rem 1.25rem; line-height: 1.25rem; transition: opacity 0.2s, background-color 0.2s; }
.btn-primary { background: var(--foreground); color: var(--background); }
.btn-primary:hover { opacity: 0.9; }
.btn-outline { border-width: 1px; }
.btn-outline:hover { background: var(--muted); }

/* ---------- Reel ---------- */
.reel { background: var(--foreground); color: var(--background); scroll-margin-top: 4rem; }
.reel-inner { padding-top: 3.5rem; padding-bottom: 3.5rem; }
.reel-copy { margin-top: 2rem; display: grid; gap: 1rem; }
.reel-title { font-size: 1.875rem; line-height: 2.25rem; }
.reel-body { font-size: 1rem; line-height: 1.625; opacity: 0.75; }
.reel-stack { margin-top: 1rem; font-size: 0.75rem; line-height: 1rem; text-transform: uppercase; letter-spacing: 0.14em; opacity: 0.5; }

/* ---------- Video ---------- */
.video-embed, .video-box { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; background: var(--muted); }
.video-box video { width: 100%; height: 100%; object-fit: cover; background: #000; }
.video-facade { position: absolute; inset: 0; width: 100%; height: 100%; }
.video-facade img { position: absolute; inset: -1px; width: calc(100% + 2px); max-width: none; height: calc(100% + 2px); object-fit: cover; transition: transform 0.5s; }
.video-facade:hover img { transform: scale(1.02); }
.video-facade-play {
    position: absolute; left: 50%; top: 50%;
    width: 4rem; height: 4rem; margin: -2rem 0 0 -2rem;
    display: grid; place-items: center;
    border-radius: 9999px;
    background: color-mix(in oklch, var(--background) 90%, transparent);
    color: var(--foreground);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    transition: transform 0.2s;
}
.video-facade:hover .video-facade-play { transform: scale(1.05); }
.video-facade-play svg { width: 1.5rem; height: 1.5rem; margin-left: 0.125rem; fill: currentColor; }
.video-facade.loaded { display: none; }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ---------- Selected work ---------- */
.work { scroll-margin-top: 5rem; }
.work-inner { padding-top: 5rem; padding-bottom: 5rem; }
.section-title { font-size: 1.875rem; line-height: 2.25rem; }
.work-group { margin-top: 3rem; }
.work-group + .work-group { margin-top: 4rem; }
.group-head { margin-bottom: 1.5rem; padding-bottom: 0.75rem; border-bottom-width: 1px; }
.carousel { position: relative; }
.carousel-btn { display: none; position: absolute; top: var(--carousel-arrow-top, 35%); z-index: 2; width: 2.75rem; height: 2.75rem; margin-top: -1.375rem; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 999px; background: var(--background); color: var(--foreground); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15); cursor: pointer; transition: opacity 0.2s, transform 0.2s; }
.carousel-btn--prev { left: 0; transform: translateX(-50%); }
.carousel-btn--next { right: 0; transform: translateX(50%); }
.carousel-btn--prev:hover { transform: translateX(-50%) scale(1.06); }
.carousel-btn--next:hover { transform: translateX(50%) scale(1.06); }
.carousel-btn:focus-visible { outline: 2px solid var(--foreground); outline-offset: 2px; }
.work-grid { display: grid; row-gap: 2rem; }
.card { display: grid; grid-template-columns: 7rem minmax(0, 1fr); column-gap: 1rem; }
.work-item { display: contents; }
.work-media { position: relative; aspect-ratio: 1 / 1; overflow: hidden; background: var(--muted); }
.work-media img { position: absolute; inset: -1px; width: calc(100% + 2px); max-width: none; height: calc(100% + 2px); object-fit: cover; transition: transform 0.5s; }
.work-item:hover .work-media img { transform: scale(1.03); }
.work-logo { position: absolute; inset: 0; z-index: 1; display: flex; align-items: center; justify-content: center; pointer-events: none; background: rgb(0 0 0 / var(--logo-dim, 0.2)); }
.work-media .work-logo img { position: static; inset: auto; width: 44%; max-width: 13rem; height: auto; object-fit: contain; transition: none; }
.work-item:hover .work-media .work-logo img { transform: none; }
@media (max-width: 767px) { .work-media .work-logo img { width: 70%; } }
.work-text { min-width: 0; }
.work-item:focus-visible .work-media { outline: 2px solid var(--foreground); outline-offset: 3px; }
.work-role { font-size: 0.6875rem; line-height: 1rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted-foreground); }
.work-title { margin-top: 0.25rem; display: flex; align-items: center; gap: 0.25rem; font-size: 1.125rem; line-height: 1.75rem; }
.work-title .icon { opacity: 0; transition: opacity 0.2s; }
.work-item:hover .work-title .icon, .work-item:focus-visible .work-title .icon { opacity: 1; }
.work-summary { margin-top: 0.25rem; font-size: 0.875rem; line-height: 1.625; color: var(--muted-foreground); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }

/* ---------- About ---------- */
.about { scroll-margin-top: 5rem; border-top-width: 1px; background: var(--card); }
.about-inner { display: grid; gap: 2rem; padding-top: 4rem; padding-bottom: 4rem; }
.about-side { display: flex; align-items: flex-end; gap: 1.25rem; }
.about-portrait { width: 8rem; flex-shrink: 0; aspect-ratio: 4 / 5; object-fit: cover; filter: grayscale(1); }
.about-title-desktop { display: none; }
.about-copy { display: grid; gap: 1rem; line-height: 1.625; color: var(--muted-foreground); }
.experience { margin-top: 2.5rem; }
.experience ul { margin-top: 1rem; border-top-width: 1px; border-bottom-width: 1px; }
.experience li { display: grid; gap: 0.125rem; padding: 0.75rem 0; font-size: 0.875rem; line-height: 1.25rem; }
.experience li + li { border-top-width: 1px; }
.experience strong { font-weight: 500; }
.exp-years { color: var(--muted-foreground); }
.education { margin-top: 1.5rem; font-size: 0.875rem; line-height: 1.25rem; color: var(--muted-foreground); }

/* ---------- Contact ---------- */
.contact { scroll-margin-top: 5rem; border-top-width: 1px; }
.contact-inner { padding-top: 6rem; padding-bottom: 6rem; }
.contact-email { margin-top: 1rem; display: block; overflow-wrap: anywhere; font-family: var(--font-display); font-size: 1.875rem; line-height: 2.25rem; font-weight: 500; letter-spacing: -0.02em; }
.contact-email:hover { text-decoration: underline; }
.contact-links { margin-top: 1.5rem; display: flex; gap: 1.5rem; font-size: 0.875rem; color: var(--muted-foreground); }
.contact-links a { padding: 0.25rem 0; }
.contact-links a:hover { color: var(--foreground); }

/* ---------- Footer ---------- */
.site-footer { border-top-width: 1px; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 2rem; padding-bottom: 2rem; font-size: 0.875rem; color: var(--muted-foreground); }
.footer-links { display: flex; gap: 1.25rem; }
.footer-links a { padding: 0.25rem 0; }
.footer-links a:hover { color: var(--foreground); }

/* ---------- Project pages ---------- */
.page-header { padding-top: 3.5rem; padding-bottom: 3.5rem; }
.back-link { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; color: var(--muted-foreground); padding: 0.25rem 0; }
.back-link:hover { color: var(--foreground); }
.page-role { margin-top: 2.5rem; }
.page-title { margin-top: 1rem; font-size: 2.25rem; line-height: 2.5rem; }
.page-lead { margin-top: 1.5rem; max-width: 48rem; font-size: 1.125rem; line-height: 1.625; color: var(--muted-foreground); }

.prose { display: grid; gap: 1rem; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }

.blocks { padding-bottom: 6rem; display: grid; gap: 5rem; }
.block { border-top-width: 1px; padding-top: 2.5rem; scroll-margin-top: 5rem; }
.block-copy { display: grid; gap: 1.5rem; }
.block-copy--after-media { margin-top: 2rem; }
.block-title { font-size: 1.5rem; line-height: 2rem; }
.block-meta { margin-top: 0.5rem; font-size: 0.875rem; line-height: 1.25rem; color: var(--muted-foreground); }
.block .prose { line-height: 1.625; color: var(--muted-foreground); }
.block-images { margin-top: 2rem; display: grid; gap: 1rem; }
.block-images img { width: 100%; object-fit: cover; }
.block-images:not(.block-images--single) img { aspect-ratio: var(--ratio, auto); height: auto; }
.block-extra { margin-top: 2.5rem; }
.block-extra-label { margin-bottom: 1rem; }
.block-link { display: block; }
.block-link .feature-title { margin-top: 0; }
.block-link:hover .feature-media img { transform: scale(1.03); }
.block-link:hover .feature-title .icon { transform: translateX(0.25rem); color: var(--foreground); }

.next-project { display: block; border-top-width: 1px; }
.next-inner { display: flex; align-items: center; justify-content: space-between; padding-top: 3.5rem; padding-bottom: 3.5rem; }
.next-title { margin-top: 0.5rem; font-family: var(--font-display); font-size: 1.875rem; line-height: 2.25rem; font-weight: 500; letter-spacing: -0.02em; }
.next-inner .icon { width: 2rem; height: 2rem; transition: transform 0.2s; }
.next-project:hover .next-inner .icon { transform: translateX(0.25rem); }

/* ---------- Featured subpages (Airtable) ---------- */
.features { padding-bottom: 5rem; }
.features-grid { border-top-width: 1px; padding-top: 2.5rem; display: grid; column-gap: 1.5rem; row-gap: 2.5rem; }
.feature { display: block; }
.feature-media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--muted); }
.feature-media img { position: absolute; inset: -1px; width: calc(100% + 2px); max-width: none; height: calc(100% + 2px); object-fit: cover; transition: transform 0.5s; }
.feature:hover .feature-media img { transform: scale(1.03); }
.feature-role { margin-top: 1rem; font-size: 0.75rem; }
.feature-title { margin-top: 0.25rem; display: flex; align-items: center; gap: 0.5rem; font-size: 1.5rem; line-height: 2rem; }
.feature-title .icon { color: var(--muted-foreground); transition: transform 0.2s, color 0.2s; }
.feature:hover .feature-title .icon { transform: translateX(0.25rem); color: var(--foreground); }
.feature-summary { margin-top: 0.5rem; max-width: 32rem; font-size: 0.875rem; line-height: 1.625; color: var(--muted-foreground); }

/* ---------- 404 ---------- */
.not-found { padding-top: 6rem; padding-bottom: 8rem; }
.not-found .hero-sub a { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Breakpoints ---------- */
/* ---------- Availability + résumé ---------- */
.hero-availability { margin-top: 1.25rem; display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; line-height: 1.25rem; font-weight: 500; }
.status-dot { width: 0.5rem; height: 0.5rem; border-radius: 9999px; background: oklch(0.62 0.15 150); box-shadow: 0 0 0 3px oklch(0.62 0.15 150 / 0.18); flex-shrink: 0; }
.cv-header { padding-bottom: 2.5rem; }
.cv-tagline { margin-top: 0.75rem; }
.cv-contact { margin-top: 0.75rem; font-size: 0.875rem; line-height: 1.5rem; color: var(--muted-foreground); overflow-wrap: anywhere; }
.cv-contact a:hover, .cv-org a:hover { text-decoration: underline; }
.cv { max-width: 48rem; padding-bottom: 5rem; }
.cv-section { border-top-width: 1px; padding-top: 1.5rem; margin-top: 2rem; }
.cv-section-title { margin-bottom: 1rem; }
.cv-summary { font-size: 1rem; line-height: 1.7; }
.cv-practice { font-size: 0.9375rem; line-height: 1.6; }
.cv-practice + .cv-practice { margin-top: 0.75rem; }
.cv-practice strong, .cv-edu strong { font-weight: 600; }
.cv-job + .cv-job { margin-top: 1.75rem; }
.cv-job-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0.25rem 1rem; }
.cv-org { font-family: var(--font-display); font-size: 1.25rem; line-height: 1.75rem; font-weight: 500; letter-spacing: -0.01em; }
.cv-years { font-size: 0.875rem; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
.cv-role { margin-top: 0.25rem; font-size: 0.875rem; color: var(--muted-foreground); }
.cv-bullets { margin-top: 0.75rem; padding-left: 1.125rem; list-style: disc; display: grid; gap: 0.5rem; font-size: 0.9375rem; line-height: 1.6; }
.cv-edu { font-size: 0.9375rem; line-height: 1.6; }
.cv-edu + .cv-edu { margin-top: 0.5rem; }

@media print {
    @page { margin: 0.45in 0.55in; }
    body { background: #fff; color: #111; font-size: 10pt; }
    .site-nav, .site-footer, .skip-link, .no-print { display: none !important; }
    .container.cv, .container.cv-header { max-width: none; width: auto; margin: 0; padding-left: 0; padding-right: 0; }
    .page-header.cv-header { padding-top: 0; padding-bottom: 0.4rem; }
    .cv-header .cv-name { margin-top: 0; font-size: 22pt; line-height: 1.1; }
    .cv-tagline, .cv-contact, .hero-availability { margin-top: 0.3rem; }
    .cv-contact, .cv-years, .cv-role, .label { color: #444; }
    .cv-contact, .cv-role, .cv-years, .hero-availability { font-size: 9pt; }
    .cv { max-width: none; padding-bottom: 0; }
    .cv-section { margin-top: 0.5rem; padding-top: 0.4rem; border-color: #bbb; }
    .cv-section-title { margin-bottom: 0.35rem; }
    .cv-summary, .cv-practice, .cv-bullets, .cv-edu { font-size: 8.8pt; line-height: 1.3; }
    .cv-bullets { margin-top: 0.2rem; gap: 0.1rem; }
    .cv-job + .cv-job { margin-top: 0.45rem; }
    .cv-org { font-size: 11.5pt; line-height: 1.3; }
    .cv-bullets li { break-inside: avoid; }
    .cv-practice + .cv-practice { margin-top: 0.3rem; }
    .cv-role { margin-top: 0.1rem; }
    .status-dot { box-shadow: none; }
    a { color: inherit; text-decoration: none; }
}

@media (min-width: 640px) {
    .card { grid-template-columns: 11rem minmax(0, 1fr); }
    .about-portrait { width: 11rem; }
    .experience li { grid-template-columns: 6.5rem 1fr; gap: 1rem; }
    .block-images { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .block-images--single { grid-template-columns: 1fr; }
}

@media (min-width: 768px) {
    .hero { padding-top: 7rem; }
    .hero-title { font-size: 3.75rem; }
    .reel-inner { padding-top: 5rem; padding-bottom: 5rem; }
    .reel-copy { grid-template-columns: 1fr 1.4fr; align-items: start; }
    .reel-title, .section-title { font-size: 2.25rem; line-height: 2.5rem; }
    .work-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 1.5rem; row-gap: 2.5rem; }
    .work-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .card { display: block; }
    .work-item { display: block; }
    .work-media { aspect-ratio: 4 / 3; }
    .work-role { margin-top: 1rem; font-size: 0.75rem; }
    .work-title { font-size: 1.25rem; }
    .work-summary { margin-top: 0.5rem; display: block; -webkit-line-clamp: none; line-clamp: none; overflow: visible; }
    .features-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .about-inner { grid-template-columns: 1fr 1.4fr; gap: 3rem; padding-top: 5rem; padding-bottom: 5rem; }
    .about-side { display: block; }
    .about-portrait { width: 100%; }
    .about-title-mobile { display: none; }
    .about-title-desktop { display: block; }
    .about-copy { margin-top: 1.5rem; }
    .contact-email { font-size: 3rem; line-height: 1; }
    .page-header { padding-top: 5rem; }
    .page-title { font-size: 3.75rem; line-height: 1; }
    .block-copy { grid-template-columns: 1fr 1.6fr; }
}

@media (min-width: 768px) {
    .work-grid--carousel { display: flex; gap: 1.5rem; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
    .work-grid--carousel::-webkit-scrollbar { display: none; }
    .work-grid--carousel > .card { flex: 0 0 calc((100% - 1.5rem) / 2.15); scroll-snap-align: start; }
    .carousel-btn:not([hidden]) { display: inline-flex; }
    .carousel-btn--prev, .carousel-btn--prev:hover { transform: none; left: 0.5rem; }
    .carousel-btn--next, .carousel-btn--next:hover { transform: none; right: 0.5rem; }
}

@media (min-width: 1024px) {
    .work-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .work-grid--carousel > .card { flex-basis: calc((100% - 4.5rem) / 4); }
    .carousel-btn--prev { left: 0; transform: translateX(-50%); }
    .carousel-btn--next { right: 0; transform: translateX(50%); }
    .carousel-btn--prev:hover { transform: translateX(-50%) scale(1.06); }
    .carousel-btn--next:hover { transform: translateX(50%) scale(1.06); }
    .block-images { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .block-images--single { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition: none !important; }
}
