/*
Theme Name: Simple Portfolio
Description: A dark, minimal sci-fi interface theme. Hairline linework, an interlocking hexagonal tile grid, a faint purple glow, and a magnetic zoom on the home page. Categories: Sketchbook, Graphic Design, Web Design.
Version: 1.4.0
Requires at least: 6.0
Requires PHP: 7.4
License: GPLv2 or later
Text Domain: simple-portfolio
*/

:root {
	--bg: #08080b;
	--surface: #101015;
	--text: #e9e9ee;
	--muted: #7d7d8a;
	--line: rgba(255, 255, 255, .10);
	--accent: #b537ff; /* electric purple */
	--accent-rgb: 181, 55, 255;
	--max: 1200px;
	--mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
	color-scheme: dark;
}

* { box-sizing: border-box; }

body {
	margin: 0;
	min-height: 100vh;
	background-color: var(--bg);
	/* very faint purple glow from the center of the screen */
	background-image: radial-gradient(ellipse at center, rgba(var(--accent-rgb), .11) 0%, rgba(var(--accent-rgb), .05) 38%, transparent 72%);
	background-attachment: fixed;
	background-repeat: no-repeat;
	overflow-anchor: none; /* header shrinks while scrolling; don't let the browser compensate */
	color: var(--text);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	line-height: 1.6;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); }

.container { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

/* Mono "readout" text used for labels */
.site-title, .main-nav a, .filter a, .tile-index, .tile-cat, .eyebrow,
.site-footer, .pagination a, .pagination span, .entry-meta {
	font-family: var(--mono);
	font-size: .72rem;
	text-transform: uppercase;
	letter-spacing: .14em;
}

/* Header */
/* Sticky header. --p is shrink progress: 0 = large, 1 = compact.
   On the home page js/header.js drives --p from scroll position;
   everywhere else the header is simply compact. */
.site-header {
	--p: 1;
	--title-big: min(1.8rem, 6vw);
	position: sticky; top: 0; z-index: 1000;
	/* glass: translucent tint, strong blur, light top highlight */
	background: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .02));
	-webkit-backdrop-filter: blur(18px) saturate(160%);
	backdrop-filter: blur(18px) saturate(160%);
	border-bottom: 1px solid rgba(255, 255, 255, .10);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .10), 0 8px 32px rgba(0, 0, 0, .25);
}
body.home .site-header { --p: 0; }
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }

.site-header .container {
	display: flex; align-items: center; justify-content: space-between;
	padding-top: calc(14px + 26px * (1 - var(--p)));
	padding-bottom: calc(14px + 26px * (1 - var(--p)));
	gap: 24px; flex-wrap: wrap;
}
.site-title {
	font-size: calc(var(--title-big) - (var(--title-big) - .85rem) * var(--p));
	letter-spacing: calc(.14em - .06em * (1 - var(--p)));
	line-height: 1.1;
	font-weight: 600; text-decoration: none; color: var(--text);
}
/* Tagline: visible while the header is large, fades and collapses as it shrinks */
.site-tagline {
	margin: calc(8px * (1 - var(--p))) 0 0;
	max-height: calc(3em * (1 - var(--p)));
	opacity: calc(1 - var(--p) * 1.6);
	overflow: hidden;
	font-family: var(--mono); font-size: .72rem; letter-spacing: .06em; line-height: 1.5;
	color: var(--muted);
}

/* Logo mark: three squares touching corner to corner, forming a right-pointing arrow (>).
   The element is the tip; the box-shadows are the two squares behind it. */
/* The mark hangs in the left gutter so the title and tagline share one left edge. */
.site-title { position: relative; display: inline-block; }
.site-title::before {
	--s: calc(4px + 2px * (1 - var(--p)));
	--g: calc(8px + 4px * (1 - var(--p))); /* gap between mark and text */
	content: ""; position: absolute;
	right: calc(100% + var(--g)); top: 50%; margin-top: calc(var(--s) / -2);
	width: var(--s); height: var(--s);
	background: var(--accent);
	box-shadow:
		calc(var(--s) * -1) calc(var(--s) * -1) 0 var(--accent),
		calc(var(--s) * -1) var(--s) 0 var(--accent);
	filter: drop-shadow(0 0 5px var(--accent));
}
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 28px; }
.main-nav a { color: var(--muted); text-decoration: none; transition: color .2s; }
.main-nav a:hover, .main-nav .current-menu-item a { color: var(--text); }

/* Header right side: LinkedIn icon, then the main nav */
.header-actions { display: flex; align-items: center; gap: 28px; }
.social-link {
	display: flex; align-items: center; justify-content: center;
	color: var(--muted); transition: color .2s, border-color .2s, background .2s;
}
.social-link svg { fill: currentColor; }
.social-link:hover, .social-link:focus-visible { color: var(--accent); }

/* Hamburger (vertical •••) menu below 900px (keep in sync with js/menu.js) */
.menu-toggle { display: none; }
@media (max-width: 899px) {
	.site-header .container { flex-wrap: nowrap; }
	.header-actions { gap: 10px; }
	.site-title::before { --g: 6px; } /* keep the hanging mark inside the 24px gutter */

	/* match the ••• button */
	.social-link {
		width: 40px; height: 40px; border-radius: 50%; color: var(--text);
		background: rgba(255, 255, 255, .06);
		border: 1px solid rgba(255, 255, 255, .18);
	}
	.social-link:hover { border-color: rgba(var(--accent-rgb), .7); background: rgba(var(--accent-rgb), .12); }

	.site-header .menu-toggle {
		display: flex; align-items: center; justify-content: center;
		width: 40px; height: 40px; padding: 0; flex: none;
		border-radius: 50%; color: var(--text);
		background: rgba(255, 255, 255, .06);
		border: 1px solid rgba(255, 255, 255, .18);
		transition: color .2s, border-color .2s, background .2s;
	}
	.menu-toggle svg { fill: currentColor; }
	.site-header .menu-toggle:hover,
	.site-header.menu-open .menu-toggle { color: var(--accent); border-color: rgba(var(--accent-rgb), .7); background: rgba(var(--accent-rgb), .12); }

	/* Dropdown panel (opaque-ish: the header's own backdrop blur can't be nested) */
	.main-nav {
		position: absolute; top: 100%; right: 16px; min-width: 200px;
		padding: 8px;
		background: rgba(14, 14, 19, .94);
		border: 1px solid rgba(255, 255, 255, .12);
		box-shadow: 0 16px 40px rgba(0, 0, 0, .45);
		opacity: 0; visibility: hidden; transform: translateY(-6px);
		transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
	}
	.menu-open .main-nav { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
	.main-nav ul { flex-direction: column; gap: 0; }
	.main-nav a { display: block; padding: 12px 14px; }
	.main-nav a:hover { background: rgba(var(--accent-rgb), .1); }
}

/* Hero */
.hero { padding: 72px 0 36px; }
.hero-small { padding: 48px 0 20px; }
.eyebrow { color: var(--accent); margin: 0 0 18px; }
.eyebrow span { color: var(--muted); }
.hero h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 300; letter-spacing: -.01em; line-height: 1.1; margin: 0 0 16px; max-width: 18ch; }
.hero p { font-size: 1.05rem; color: var(--muted); max-width: 50ch; margin: 0; }


/* ---------- Hexagon tile grid ----------
   js/magnet.js lays the hexagons out as an interlocking honeycomb (.hex-js).
   Without JS they fall back to a centered, wrapping row. */
.tile-grid {
	display: flex; flex-wrap: wrap; justify-content: center;
	margin-bottom: 64px;
	padding: 24px 0;
}
.tile-grid.hex-js { display: block; position: relative; padding: 0; margin-top: 40px; }

.tile {
	--glow: 0; /* 0..1, driven by cursor proximity (js/magnet.js) */
	position: relative;
	width: 260px;
	aspect-ratio: 1 / 1.1547; /* pointy-top regular hexagon */
	will-change: transform;
	transform-origin: center;
	filter: drop-shadow(0 0 calc(16px * var(--glow)) rgba(var(--accent-rgb), calc(.55 * var(--glow))));
}
.hex-js .tile { position: absolute; }
.tile:hover, .tile:focus-within { --glow: 1; }
@media (hover: none) { .tile { --glow: .5; } }

/* Only the hexagon itself is clickable/hoverable, not its bounding box */
.tile a { display: block; position: relative; width: 100%; height: 100%; color: inherit; text-decoration: none; pointer-events: none; }
.tile-inner, .tile-outline { pointer-events: none; }

.tile-inner {
	position: absolute; inset: 3px;
	pointer-events: auto;
	clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); /* keep in sync with the SVG outline in post-tile.php */
	background: var(--surface);
	overflow: hidden;
}
.tile-inner img, .tile-blank {
	position: absolute; inset: 0; width: 100%; height: 100%;
	object-fit: cover; object-position: center center; display: block;
	filter: saturate(calc(.45 + .55 * var(--glow))) brightness(calc(.62 + .38 * var(--glow)));
}
.tile-blank { background: radial-gradient(circle at 50% 40%, #181820, #0c0c10); }

/* Hexagon linework (outer outline + faint inner outline) */
.tile-outline {
	position: absolute; inset: 3px; width: calc(100% - 6px); height: calc(100% - 6px);
	overflow: visible;
}
.tile-outline polygon { fill: none; vector-effect: non-scaling-stroke; stroke-linejoin: miter; }
.tile-outline .o1 { stroke: rgba(var(--accent-rgb), calc(.30 + .70 * var(--glow))); stroke-width: 1; }
.tile-outline .o2 { stroke: rgba(255, 255, 255, calc(.10 + .30 * var(--glow))); stroke-width: 1; }

.tile-index {
	position: absolute; top: 13%; left: 0; right: 0; text-align: center; z-index: 1;
	color: rgba(255, 255, 255, .8);
	text-shadow: 0 1px 6px rgba(0, 0, 0, .8);
}

.tile-caption {
	position: absolute; inset: 0;
	padding: 0 16% calc(25%);
	display: flex; flex-direction: column; align-items: center; justify-content: flex-end; text-align: center; gap: 4px;
	background: linear-gradient(to top, rgba(8, 8, 11, .92) 0%, rgba(8, 8, 11, .55) 35%, transparent 70%);
	opacity: 0; transform: translateY(6px);
	transition: opacity .25s ease, transform .25s ease;
}
.tile:hover .tile-caption, .tile a:focus-visible .tile-caption { opacity: 1; transform: none; }
.tile-cat { color: var(--accent); }
.tile-title { font-weight: 300; font-size: .75rem; line-height: 1.3; text-transform: uppercase; letter-spacing: .08em; }
@media (hover: none) { .tile-caption { opacity: 1; transform: none; } }

.empty { color: var(--muted); font-family: var(--mono); }

/* Pagination */
.pagination .nav-links { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 64px; }
.pagination a, .pagination span { padding: 7px 14px; border: 1px solid var(--line); color: var(--muted); text-decoration: none; }
.pagination a:hover { color: var(--text); border-color: rgba(var(--accent-rgb), .6); }
.pagination .current { color: var(--accent); border-color: var(--accent); }

/* Content */
.entry { max-width: 760px; margin: 56px auto 80px; }
.entry-title { font-size: 2.25rem; font-weight: 300; line-height: 1.15; margin: 0 0 8px; }
.entry-meta { color: var(--muted); margin-bottom: 32px; }
.entry-featured { margin-bottom: 32px; border: 1px solid var(--line); overflow: hidden; }

.post-list article { padding: 24px 0; border-bottom: 1px solid var(--line); }
.post-list h2 { margin: 0 0 4px; font-weight: 400; }
.post-list h2 a { color: var(--text); text-decoration: none; }

/* Comments / forms */
input[type="text"], input[type="email"], input[type="url"], input[type="search"], textarea {
	width: 100%; padding: 10px 12px; background: var(--surface); color: var(--text);
	border: 1px solid var(--line); border-radius: 0; font: inherit;
}
input:focus, textarea:focus { outline: none; border-color: var(--accent); }
input[type="submit"], button {
	padding: 10px 18px; background: transparent; color: var(--accent);
	border: 1px solid var(--accent); border-radius: 0; cursor: pointer;
	font-family: var(--mono); text-transform: uppercase; letter-spacing: .14em; font-size: .72rem;
}
input[type="submit"]:hover, button:hover { background: rgba(var(--accent-rgb), .15); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0; color: var(--muted); }

/* ---------- Single post navigation ---------- */
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 760px; margin: 0 auto 80px; }
.post-nav-card {
	position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden;
	border: 1px solid var(--line); background: var(--surface);
	color: var(--text); text-decoration: none;
	transition: border-color .25s, box-shadow .25s;
}
.post-nav-card.is-next { grid-column: 2; text-align: right; }
.post-nav-card.is-prev { grid-column: 1; }
.post-nav-card:hover { border-color: var(--accent); box-shadow: 0 0 20px rgba(var(--accent-rgb), .25); }
.post-nav-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; filter: brightness(.5) saturate(.7); transition: filter .3s; }
.post-nav-card:hover img { filter: brightness(.75) saturate(1); }
.post-nav-text { position: absolute; inset: auto 0 0 0; padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; background: linear-gradient(to top, rgba(8, 8, 11, .85), transparent); }
.post-nav-label { font-family: var(--mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .14em; color: var(--accent); }
.post-nav-title { font-size: 1rem; line-height: 1.25; }
@media (max-width: 560px) {
	.post-nav { grid-template-columns: 1fr; }
	.post-nav-card.is-next, .post-nav-card.is-prev { grid-column: 1; }
}

/* Ghost floating arrows on the left/right edges */
.post-float {
	position: fixed; top: 50%; z-index: 900;
	width: 52px; height: 52px; margin-top: -26px; border-radius: 50%;
	display: flex; align-items: center; justify-content: center;
	color: var(--text); text-decoration: none;
	/* dark-tinted glass so the arrow stays readable over light backgrounds */
	background: rgba(8, 8, 11, .38);
	-webkit-backdrop-filter: blur(14px) saturate(160%);
	backdrop-filter: blur(14px) saturate(160%);
	border: 1px solid rgba(255, 255, 255, .22);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 4px 20px rgba(0, 0, 0, .25);
	transition: opacity .25s, color .25s, transform .25s, border-color .25s, box-shadow .25s;
}
.post-float svg { width: 14px; height: 28px; overflow: visible; }
.post-float polyline { fill: none; stroke: currentColor; stroke-width: 1; vector-effect: non-scaling-stroke; }
.post-float.is-prev { left: 8px; }
.post-float.is-next { right: 8px; }
.post-float:hover, .post-float:focus-visible {
	color: var(--accent);
	border-color: rgba(var(--accent-rgb), .7);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 0 20px rgba(var(--accent-rgb), .35);
}
.post-float.is-prev:hover { transform: translateX(-4px); }
.post-float.is-next:hover { transform: translateX(4px); }
@media (hover: none) { .post-float { display: none; } } /* touch devices swipe instead */
@media (max-width: 900px) { .post-float { width: 44px; height: 44px; margin-top: -22px; } }

/* Accessibility */
.screen-reader-text {
	position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0);
}
