/*
Theme Name: Matt Wink
Theme URI: https://matt-wink.com
Author: Matt Winkler
Description: Custom portfolio theme for matt-wink.com. Feed of selected projects, project pages and an about page.
Version: 1.1.9
Requires at least: 6.9
Requires PHP: 8.1
Text Domain: mattwink
*/

:root {
	--mw-ink: #111;
	--mw-muted: #777;
	--mw-bg: #fff;
	--mw-line: 1px solid #111;
	--mw-accent: #ff3b1f;
	--mw-radius: 12px;
	--mw-gap: 6px;
	--mw-pad: 16px;
	--mw-col-gap: 24px;
	--mw-font: "Inter Tight", "Helvetica Neue", Arial, sans-serif;
	--mw-pixel: "Silkscreen", ui-monospace, monospace;
	--mw-size: clamp(15px, 1.15vw, 20px);
}

@font-face {
	font-family: "OCR A";
	src: url("assets/fonts/OCRA.ttf") format("truetype");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--mw-bg);
	color: var(--mw-ink);
	font-family: var(--mw-font);
	font-size: var(--mw-size);
	line-height: 1.38;
	overflow-x: clip;
}
:where(h1, h2, h3, p, figure, dl, dd, ul, ol, blockquote) { margin: 0; padding: 0; }
:where(ul, ol) { list-style: none; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--mw-ink); text-decoration: none; }
a:hover { color: var(--mw-muted); }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 100; width: auto; height: auto; clip: auto; background: #fff; padding: 8px 12px; border: var(--mw-line); }

/* Grid used by header, rows and footer */
.mw-g { display: grid; grid-template-columns: 25fr 33fr 42fr; column-gap: var(--mw-col-gap); padding: 0 var(--mw-pad); }
.mw-k { color: var(--mw-muted); }
.mw-px { font-family: var(--mw-pixel); font-size: 11px; line-height: 1; letter-spacing: .04em; text-transform: uppercase; }

/* Header */
.mw-header { align-items: center; height: 70px; border-bottom: var(--mw-line); }
.mw-name { display: flex; align-items: center; gap: 10px; }
.mw-nav-current { text-decoration: underline; text-underline-offset: 4px; }
.mw-header .mw-c1 { color: var(--mw-c1, #D7001F); }
.mw-header .mw-c2 { color: var(--mw-c2, #0047FF); }
.mw-header .mw-c3 { color: var(--mw-c3, #00873C); }
.mw-header a:hover { opacity: .6; }
.mw-tally { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--mw-accent); animation: mw-blink 1.6s steps(1) infinite; }
.mw-tag { display: inline-flex; align-items: center; padding: 4px 6px 3px; border-radius: 999px; border: 1px solid var(--mw-ink); animation: mw-flash 1.1s steps(1) infinite; }
@keyframes mw-blink { 0% { opacity: 1; } 50% { opacity: .12; } }
@keyframes mw-flash { 0% { background: var(--mw-ink); color: #fff; } 50% { background: transparent; color: var(--mw-ink); } }

/* Media */
.mw-media { overflow: hidden; background: #1e1e1d; border-radius: var(--mw-radius); position: relative; min-width: 0; }
.mw-media img, .mw-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.mw-media-empty { color: #8e8e89; display: flex; align-items: flex-end; padding: 10px; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; }

/* Feed rows */
.mw-row { border-bottom: var(--mw-line); padding: 22px 0 48px; display: flex; flex-direction: column; gap: 14px; }
.mw-row-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.mw-row .mw-row-title { font-weight: 700; }
.mw-row .mw-row-title .mw-tag { font-weight: 400; }
.mw-row-body { align-items: start; }
.mw-strip { grid-column: 1 / span 2; display: flex; gap: var(--mw-gap); }
.mw-strip .mw-media { flex: var(--ar) 1 0; aspect-ratio: var(--ar); }
.mw-credits { display: flex; flex-direction: column; padding-top: 6px; }
.mw-credits .mw-spacer { height: 1.38em; }

/* Sticker (home) */
.mw-sticker { position: fixed; top: 10px; right: clamp(16px, 3vw, 48px); width: 200px; z-index: 50; perspective: 800px; will-change: transform; }
.mw-sticker img { width: 100%; transform: rotate(6deg); will-change: transform; filter: drop-shadow(0 6px 10px rgba(0,0,0,.12)); }

/* DVD logo (about) */
.mw-dvd { position: fixed; left: 0; top: 0; width: 150px; z-index: 50; pointer-events: none; will-change: transform; }
.mw-dvd img { width: 100%; filter: drop-shadow(0 6px 10px rgba(0,0,0,.12)); }

/* Project page */
.mw-project { padding: clamp(40px, 6vw, 96px) var(--mw-pad) 0; display: flex; flex-direction: column; gap: clamp(64px, 8vw, 128px); }
.mw-player { aspect-ratio: 16 / 9; }
.mw-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.mw-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: inline-flex; align-items: center; gap: 10px; padding: 16px 24px 15px; border-radius: 999px; border: 1px solid #fff; background: rgba(0,0,0,.25); color: #fff; font-size: 14px; cursor: pointer; backdrop-filter: blur(2px); }
.mw-play:hover { background: rgba(0,0,0,.45); }
.mw-ig { min-width: 0; border-radius: var(--mw-radius); overflow: hidden; background: #fff; border: 1px solid #e3e3e3; aspect-ratio: 340 / 567; position: relative; }
.mw-ig iframe { display: block; width: 100%; height: 100%; border: 0; }
.mw-ig-scale iframe { position: absolute; top: 0; left: 0; width: 340px; height: 567px; transform-origin: 0 0; }
.mw-ig-hero { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 32px clamp(24px, 4vw, 64px); align-items: start; }
.mw-ig-info { display: flex; flex-direction: column; gap: 28px; }
.mw-ig-info .mw-titlebar { margin-top: 0; }
.mw-ig-info .mw-desc { grid-column: auto; }
.mw-ig-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.mw-ig-hero + .mw-ig-row { margin-top: calc(24px - clamp(64px, 8vw, 128px)); }
.mw-titlebar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
.mw-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 32px 24px; align-items: start; }
.mw-meta { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 0 12px; }
.mw-meta dt { color: var(--mw-muted); }
.mw-desc { grid-column: span 2; max-width: 620px; text-wrap: pretty; }
.mw-desc p + p { margin-top: 1em; }
.mw-stills { display: flex; flex-direction: column; gap: 20px; }
.mw-stills-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 20px; }
.mw-stills .mw-media { aspect-ratio: var(--ar, 16 / 9); }
.mw-stills-solo { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 20px; }
.mw-stills-solo .mw-media { grid-column: 7 / -1; }
.mw-next { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: end; border-top: var(--mw-line); padding-top: 16px; }
.mw-next-text { grid-column: 1 / span 6; display: flex; flex-direction: column; }
.mw-next .mw-media { grid-column: 9 / -1; aspect-ratio: 16 / 9; }

/* About */
.mw-about-main { min-height: calc(100vh - 70px); display: flex; flex-direction: column; justify-content: center; }
.mw-about { padding: clamp(40px, 6vw, 96px) 0; }
.mw-about-body { display: flex; flex-direction: row-reverse; justify-content: center; align-items: center; gap: clamp(40px, 5vw, 96px); }
.mw-portrait-wrap { flex: 0 1 min(48vw, 820px); display: flex; }
.mw-portrait-box { width: 100%; min-width: 260px; display: flex; flex-direction: column; gap: 14px; }
.mw-about-line { text-transform: uppercase; }
.mw-portrait { width: 100%; aspect-ratio: 3 / 2; }
.mw-bio { flex: 0 1 560px; display: flex; flex-direction: column; gap: 1.1em; }
.mw-bio p { text-wrap: pretty; }
.mw-bio a { text-decoration: underline; text-underline-offset: 4px; }
.mw-icons { display: flex; gap: 4px; margin: 10px 0 0 -12px; }
.mw-icon { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; }

/* Body text: Space Mono for project and about content (header and footer keep Inter Tight) */
#main { font-family: "Space Mono", ui-monospace, Menlo, monospace; font-size: clamp(12px, .9vw, 15px); line-height: 1.55; }
#main .mw-row > .mw-g:first-child, #main .mw-titlebar h1 { text-transform: uppercase; }
#main .mw-credits .mw-spacer { height: 1.55em; }

/* Generic page fallback */
.mw-page { padding: 22px var(--mw-pad) 120px; max-width: 760px; }
.mw-page h1 { font-size: inherit; font-weight: 400; margin-bottom: 28px; }
.mw-page p + p { margin-top: 1em; }

/* Footer */
.mw-footer { padding-top: 22px; padding-bottom: 28px; color: var(--mw-muted); }
.mw-footer a { color: var(--mw-muted); }
.mw-footer a:hover { color: var(--mw-ink); }
.mw-footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.mw-footer .mw-px { align-self: center; color: var(--mw-ink); justify-self: start; padding: 6px 0; }
.mw-footer a.mw-px:hover { color: var(--mw-muted); }
.mw-footer-top { margin-top: clamp(96px, 12vw, 180px); border-top: var(--mw-line); }

@media (max-width: 1100px) { .mw-ig-row { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

@media (max-width: 800px) {
	.mw-g { grid-template-columns: 1fr 1fr; }
	.mw-header { display: flex; justify-content: flex-start; column-gap: 22px; padding-right: 100px; }
	.mw-strip, .mw-portrait-wrap { grid-column: 1 / -1; }
	.mw-credits, .mw-bio, .mw-wide-text { grid-column: 1 / -1; padding-top: 14px; }
	.mw-portrait-box { width: 100%; min-width: 0; }
	.mw-about-body { flex-direction: column; align-items: stretch; gap: 24px; }
	.mw-portrait-wrap, .mw-bio { flex: none; }
	.mw-row .mw-hd { display: none; }
	.mw-strip { padding-left: 0 !important; padding-right: 0 !important; }
	/* Logo sits in the empty right side of the header on phones. */
	.mw-sticker { position: absolute; top: 2px; right: 14px; width: 76px; }
	.mw-dvd { position: absolute; top: 2px; right: 14px; left: auto; width: 76px; }
	.mw-desc { grid-column: auto; }
	.mw-ig-hero { grid-template-columns: 1fr; }
	.mw-ig-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.mw-footer { grid-template-columns: repeat(3, auto); justify-content: space-between; }
}

/* Featured article cards */
.mw-articles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 16px; }
.mw-article { display: flex; flex-direction: column; gap: 14px; padding: 22px 24px; border: 1px solid currentColor; border-radius: 14px; color: inherit; text-decoration: none; transition: background .2s, color .2s; }
.mw-article:hover, .mw-article:focus-visible { background: #000; color: #fff; }
.mw-article-src { font-size: 11px; letter-spacing: .04em; }
.mw-article-title { text-transform: uppercase; font-size: 1.15em; line-height: 1.35; }
.mw-article-go { opacity: .7; }
.mw-article-hero { grid-column: 1 / -1; position: relative; display: block; aspect-ratio: 2.39 / 1; color: #fff; text-decoration: none; }
.mw-article-hero::after { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.18); transition: background .25s; }
.mw-article-hero .mw-article { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 1; width: min(440px, calc(100% - 32px)); border-color: #fff; background: rgba(0,0,0,.3); backdrop-filter: blur(3px); }
.mw-article-hero:hover::after, .mw-article-hero:focus-visible::after { background: rgba(0,0,0,.05); }
.mw-article-hero:hover .mw-article, .mw-article-hero:focus-visible .mw-article { background: #fff; color: #000; }
.mw-article-hero .mw-article-go { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
	.mw-tally, .mw-tag { animation: none; }
}
