:root {
	--bg: #17141C;
	--panel: #211C2C;
	--purple: #5F378C;
	--purple-bright: #9B6FD1;
	--purple-line: #3D3350;
	--text: #F3F0F7;	--text-dim: #E8E4EF;        /* brighter than before, closer to white */
	--text-dimmer: #B8AFC7;    						 /* also brighter, still a step down from text-dim */
	--amber: #D9A15B;
	--border: #322A40;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
	background: var(--bg);
	color: var(--text);
	font-family: 'IBM Plex Sans', sans-serif;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}
.mono { font-family: 'IBM Plex Mono', monospace; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 5vw; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--purple-bright); }

/* ---------- Nav ---------- */
header.site-nav {
	position: sticky;
	top: 0;
	z-index: 50;
	background: rgba(23, 20, 28, 0.92);
	backdrop-filter: blur(8px);
	border-bottom: 1px solid var(--border);
}
.nav-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 22px 0;
	position: relative;
	gap: 16px;
}
.brand {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
	flex-shrink: 1;
}
.brand img.brand-logo {
	height: 30px;
	width: auto;
	flex-shrink: 0;
}
.brand-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.brand-name {
	font-weight: 600;
	font-size: 16px;
	letter-spacing: 0.01em;
	white-space: nowrap;
}
.brand-tag {
	font-family: 'IBM Plex Mono', monospace;
	font-size: 14px;
	letter-spacing: 0.05em;
	text-transform: lowercase;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

nav.links { display: flex; gap: clamp(14px, 2.5vw, 32px); flex-shrink: 0; }
nav.links a {
	font-size: 16px;
	color: var(--text-dim);
	white-space: nowrap;
	transition: color 0.15s ease;
}
nav.links a:hover { color: var(--purple-bright); }

.nav-toggle { display: none; }
.nav-toggle-label {
	display: none;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	width: 32px;
	height: 32px;
	cursor: pointer;
	flex-shrink: 0;
}
.nav-toggle-label span {
	display: block;
	width: 22px;
	height: 2px;
	background: var(--text-dim);
	transition: all 0.15s ease;
}

/* ---------- Hero ---------- */
.hero {
	position: relative;
	overflow: hidden;
	padding: clamp(56px, 9vw, 120px) 0 clamp(48px, 7vw, 100px);
	border-bottom: 1px solid var(--border);
}
.hero-grid {
	position: absolute;
	inset: 0;
	background-image:
		linear-gradient(var(--purple-line) 1px, transparent 1px),
		linear-gradient(90deg, var(--purple-line) 1px, transparent 1px);
	background-size: clamp(36px, 5vw, 64px) clamp(36px, 5vw, 64px);
	opacity: 0.35;
	mask-image: radial-gradient(ellipse 55% 45% at 50% 38%, black 0%, transparent 75%);
	-webkit-mask-image: radial-gradient(ellipse 55% 45% at 50% 38%, black 0%, transparent 75%);
}
.flag {
	position: absolute;
	width: 9px;
	height: 9px;
	background: var(--amber);
	opacity: 0.7;
	border-radius: 1px;
}

.sprite-purple {
	position: absolute;
	width: 9px;
	height: 9px;
	background: var(--purple-bright);
	opacity: 0.7;
	border-radius: 1px;
}

.hero-inner { position: relative; z-index: 2; max-width: 680px; }
.eyebrow {
	font-family: 'IBM Plex Mono', monospace;
	font-size: 12px;
	letter-spacing: 0.08em;
	color: var(--purple-bright);
	text-transform: lowercase;
	margin-bottom: 20px;
	display: inline-block;
}
h1.headline {
	font-size: clamp(28px, 5.2vw, 50px);
	font-weight: 600;
	line-height: 1.15;
	letter-spacing: -0.01em;
	margin-bottom: 22px;
}
.sub {
	font-size: clamp(14.5px, 1.8vw, 17px);
	color: var(--text-dim);
	max-width: 560px;
	margin-bottom: 32px;
}
.cta-row { display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
	font-size: 14px;
	font-weight: 500;
	padding: 13px 24px;
	border-radius: 4px;
	display: inline-block;
	transition: all 0.15s ease;
	text-align: center;
}
.btn-primary { background: var(--purple); color: #fff; border: 1px solid var(--purple); }
.btn-primary:hover { background: var(--purple-bright); border-color: var(--purple-bright); }
.btn-secondary { border: 1px solid var(--border); color: var(--text-dim); }
.btn-secondary:hover { border-color: var(--text-dim); color: var(--text); }

/* ---------- Sections ---------- */
section { padding: clamp(48px, 8vw, 90px) 0; border-bottom: 1px solid var(--border); }
section:nth-of-type(even) { background: rgba(255,255,255,0.012); }
.section-head { max-width: 560px; margin-bottom: clamp(28px, 4vw, 48px); }
.section-head .eyebrow { margin-bottom: 14px; }
h2.section-title { font-size: clamp(22px, 3.2vw, 28px); font-weight: 600; letter-spacing: -0.01em; }

/* ---------- Problem list ---------- */
.problem-list { display: grid; gap: 10px; }
.problem-row {
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: 8px;
	padding: 16px 18px;
	display: flex;
	align-items: center;
	gap: 14px;
}
.problem-row .mark {
	font-family: 'IBM Plex Mono', monospace;
	font-size: 11px;
	color: var(--amber);
	background: rgba(217, 161, 91, 0.12);
	width: 28px;
	height: 28px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}
.problem-row p { font-size: 14.5px; color: var(--text-dim); }

/* ---------- Services ---------- */
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.service-card {
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: 10px;
	padding: 28px;
}
.service-card .num {
	font-family: 'IBM Plex Mono', monospace;
	font-size: 13px;
	color: var(--purple-bright);
	background: rgba(155, 111, 209, 0.12);
	width: 36px;
	height: 36px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 16px;
}
.service-card h3 { font-size: 18px; font-weight: 600; margin-bottom: 10px; }
.service-card p.desc { font-size: 14px; color: var(--text-dim); margin-bottom: 16px; }
.service-card .price {
	font-family: 'IBM Plex Mono', monospace;
	font-size: 13px;
	color: var(--purple-bright);
	padding-top: 14px;
	border-top: 1px dashed var(--border);
}

/* ---------- Tools ---------- */
.tools-strip { display: flex; flex-wrap: wrap; gap: 10px; }
.tool-pill {
	font-family: 'IBM Plex Mono', monospace;
	font-size: 12.5px;
	padding: 9px 16px;
	border: 1px solid var(--border);
	border-radius: 20px;
	color: var(--text-dim);
}

/* ---------- Work ---------- */
.work-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.work-item { background: var(--panel); padding: 22px; }
.work-item .work-title { font-size: 14.5px; font-weight: 500; margin-bottom: 4px; }
.work-item .work-meta { font-family: 'IBM Plex Mono', monospace; font-size: 11.5px; color: var(--text-dimmer); }

/* ---------- Footer ---------- */
footer { padding: clamp(36px, 6vw, 60px) 0 clamp(24px, 4vw, 40px); position: relative; overflow: hidden; }
.footer-row {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 12px;
}
.footer-tag { font-size: 14.5px; color: var(--text-dim); }
.footer-meta { text-align: center; }
.footer-meta p { font-size: 12px; color: var(--text-dimmer); font-family: 'IBM Plex Mono', monospace; }

/* ---------- Inner page content (non-homepage pages) ---------- */
.page-content { padding: clamp(40px, 6vw, 70px) 0 clamp(60px, 8vw, 100px); }
.page-content > p.intro {
	font-size: clamp(14.5px, 1.6vw, 16px);
	color: var(--text-dim);
	max-width: 720px;
	margin-bottom: 36px;
}

/* ---------- Service accordion (.svc) ---------- */
details.svc {
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: 10px;
	padding: 22px 26px;
	margin-bottom: 16px;
}
details.svc summary {
	cursor: pointer;
	list-style: none;
	font-size: clamp(17px, 2.2vw, 20px);
	font-weight: 600;
	color: var(--text);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}
details.svc summary::-webkit-details-marker { display: none; }
details.svc summary::after {
	content: '+';
	font-family: 'IBM Plex Mono', monospace;
	font-size: 20px;
	color: var(--purple-bright);
	flex-shrink: 0;
	transition: transform 0.15s ease;
}
details.svc[open] summary::after { content: '\2212'; }
details.svc summary strong { font-weight: 600; }

details.svc p {
	font-size: 14.5px;
	color: var(--text-dim);
	margin: 16px 0 4px;
	max-width: 680px;
}
details.svc ul {
	list-style: none;
	margin-top: 10px;
}
details.svc > ul > li {
	font-size: 14px;
	color: var(--text-dim);
	padding: 10px 0;
	border-top: 1px dashed var(--border);
}
details.svc > ul > li:first-child { border-top: none; padding-top: 14px; }
details.svc > ul > li > strong { color: var(--text); }
details.svc ul ul {
	margin-top: 8px;
	margin-left: 4px;
}
details.svc ul ul li {
	padding: 5px 0 5px 18px;
	position: relative;
	border-top: none;
	font-size: 13.5px;
}
details.svc ul ul li::before {
	content: '';
	position: absolute;
	left: 0;
	top: 13px;
	width: 5px;
	height: 5px;
	background: var(--purple-bright);
	border-radius: 50%;
}
details.svc em {
	font-style: normal;
	color: var(--purple-bright);
	font-family: 'IBM Plex Mono', monospace;
	font-size: 13px;
}

.svc-footnote {
	font-size: 13px;
	color: var(--text-dimmer);
	text-align: center;
	margin: 8px 0 32px;
}

.cta-center { text-align: center; margin-top: 8px; }
.cta-center .btn-primary { padding: 14px 34px; }

/* ---------- Link panel (e.g. Analytics & Portfolio) ---------- */
.link-panel {
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: 10px;
	padding: 30px 32px;
	max-width: 420px;
}
.link-panel h3 {
	font-size: 19px;
	font-weight: 600;
	margin-bottom: 20px;
}
.link-panel ul { list-style: none; }
.link-panel li { border-top: 1px solid var(--border); }
.link-panel li:first-child { border-top: none; }
.link-panel a {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 0;
	font-size: 15px;
	color: var(--text-dim);
	transition: color 0.15s ease;
}
.link-panel a:hover { color: var(--text); }
.link-panel a svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--purple-bright); }
.link-panel a .sep { color: var(--text-dimmer); }

/* ---------- Bio / intro block (homepage) ---------- */
#intro { padding: clamp(56px, 9vw, 110px) 0 clamp(60px, 9vw, 100px); }
.bio-block { max-width: 680px; }
.bio-name {
	font-size: clamp(30px, 4.5vw, 42px);
	font-weight: 600;
	letter-spacing: -0.01em;
	margin-bottom: 10px;
}
.bio-title {
	font-size: clamp(14.5px, 1.8vw, 16px);
	color: var(--text-dim);
	margin-bottom: 6px;
}
.bio-tools {
	font-size: 12.5px;
	color: var(--purple-bright);
	letter-spacing: 0.02em;
	margin-bottom: 32px;
}
.bio-block p {
	font-size: clamp(14.5px, 1.7vw, 16px);
	color: var(--text-dim);
	margin-bottom: 26px;
	line-height: 1.75;
}
.bio-list {
	list-style: none;
	margin: 12px 0 36px;
	padding: 28px 0;
	border-top: 1px solid var(--border);
	border-bottom: 1px solid var(--border);
	display: grid;
	gap: 18px;
}
.bio-list li {
	font-size: 14.5px;
	color: var(--text-dim);
	line-height: 1.6;
	padding-left: 20px;
	position: relative;
}
.bio-list li::before {
	content: '';
	position: absolute;
	left: 0;
	top: 9px;
	width: 5px;
	height: 5px;
	background: var(--purple-bright);
	border-radius: 50%;
}
.bio-list li strong { color: var(--text); }

/* ---------- Masthead logo (shown below nav, above content, every page) ---------- */
.masthead { padding: 36px 0 8px; text-align: center; }
.masthead img { height: 64px; width: auto; margin: 0 auto; }

/* ---------- Two-column layout: main content + persistent sidebar ---------- */
.layout-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 300px;
	gap: 56px;
	align-items: start;
	padding: clamp(30px, 5vw, 50px) 0 clamp(60px, 8vw, 90px);
}
.main-col { min-width: 0; }
.side-col { position: sticky; top: 90px; display: flex; flex-direction: column; gap: 20px; }

.side-panel {
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: 10px;
	padding: 22px 24px;
}
.side-panel h4 {
	font-size: 12px;
	font-family: 'IBM Plex Mono', monospace;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--text-dimmer);
	margin-bottom: 16px;
}
.side-panel .focus-group { margin-bottom: 16px; }
.side-panel .focus-group:last-of-type { margin-bottom: 0; }
.side-panel .focus-label {
	font-size: 13px;
	font-weight: 600;
	color: var(--purple-bright);
	margin-bottom: 6px;
}
.side-panel .focus-group ul { list-style: none; }
.side-panel .focus-group li {
	font-size: 13.5px;
	color: var(--text-dim);
	padding: 3px 0;
}
.side-panel .updated {
	font-size: 11px;
	color: var(--text-dimmer);
	font-family: 'IBM Plex Mono', monospace;
	margin-top: 16px;
	padding-top: 14px;
	border-top: 1px solid var(--border);
}
.side-panel ul.plain-list { list-style: none; }
.side-panel ul.plain-list li { border-top: 1px solid var(--border); }
.side-panel ul.plain-list li:first-child { border-top: none; }
.side-panel ul.plain-list a {
	display: block;
	padding: 10px 0;
	font-size: 13.5px;
	color: var(--text-dim);
}
.side-panel ul.plain-list a:hover { color: var(--text); }
.side-panel ul.icon-list { list-style: none; }
.side-panel ul.icon-list li { border-top: 1px solid var(--border); }
.side-panel ul.icon-list li:first-child { border-top: none; }
.side-panel ul.icon-list a {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 0;
	font-size: 13.5px;
	color: var(--text-dim);
}
.side-panel ul.icon-list a:hover { color: var(--text); }
.side-panel ul.icon-list svg { width: 15px; height: 15px; flex-shrink: 0; color: var(--purple-bright); }

@media (max-width: 900px) {
	.layout-grid { grid-template-columns: 1fr; gap: 32px; }
	.side-col { position: static; }
	.wrap { padding: 0 2vw; }
}

/* ---------- Simple content page helpers ---------- */
.main-col h2.subhead { font-size: 20px; font-weight: 600; margin: 36px 0 14px; }
.main-col p { font-size: 15px; color: var(--text-dim); margin-bottom: 18px; line-height: 1.7; max-width: 680px; }
.main-col ul.plain { list-style: none; margin: 12px 0 24px; display: grid; gap: 10px; }
.main-col ul.plain li { font-size: 14.5px; color: var(--text-dim); padding-left: 18px; position: relative; }
.main-col ul.plain li::before { content:''; position:absolute; left:0; top:8px; width:5px; height:5px; background:var(--purple-bright); border-radius:50%; }
.section-divider { border: none; border-top: 1px solid var(--border); margin: 32px 0; }
.tag-line { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--purple-bright); margin-bottom: 6px; }

/* Portfolio / notebook entries */
.entry-card {
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: 10px;
	overflow: hidden;
	margin-bottom: 20px;
}
.entry-card img { width: 100%; display: block; }
.entry-card .entry-body { padding: 22px 24px; }
.entry-card h3 { font-size: 18px; font-weight: 600; margin-bottom: 10px; }
.entry-card p { margin-bottom: 14px; }
.entry-card a.entry-link { color: var(--purple-bright); font-size: 13.5px; font-family: 'IBM Plex Mono', monospace; }

/* Contact form */
.contact-form { display: grid; gap: 16px; max-width: 480px; margin-top: 24px; }
.contact-form label { font-size: 13px; color: var(--text-dim); margin-bottom: 6px; display: block; }
.contact-form input, .contact-form textarea {
	width: 100%;
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: 6px;
	padding: 11px 14px;
	color: var(--text);
	font-family: 'IBM Plex Sans', sans-serif;
	font-size: 14px;
}
.contact-form textarea { min-height: 130px; resize: vertical; }
.contact-form button { justify-self: start; }

@media (min-width: 901px) and (max-width: 1400px) {
	.wrap { padding: 0 2vw; }
}

/* Tablet-and-down: iPad portrait, all phone orientations. Hamburger nav kicks in here. */
@media (max-width: 980px) {
	.nav-toggle-label { display: flex; }
	nav.links {
		display: none;
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		flex-direction: column;
		gap: 0;
		background: var(--panel);
		border-bottom: 1px solid var(--border);
		box-shadow: 0 12px 24px rgba(0,0,0,0.3);
	}
	nav.links a {
		padding: 16px 5vw;
		border-top: 1px solid var(--border);
		font-size: 15px;
	}
	.nav-toggle:checked ~ .links { display: flex; }
	.nav-toggle:checked ~ .nav-toggle-label span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
	.nav-toggle:checked ~ .nav-toggle-label span:nth-child(2) { opacity: 0; }
	.nav-toggle:checked ~ .nav-toggle-label span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

	.btn { width: 100%; }
	.cta-row { flex-direction: column; }
}

/* Small phones only, both orientations */
@media (max-width: 480px) {
	.brand-tag { display: none; }
	.wrap { padding: 0 4vw; }
	.problem-row { padding: 14px; }
	.service-card { padding: 22px; }
	.footer-row { flex-direction: column; align-items: center; }
	.footer-meta { text-align: center; }
}

/* Very short viewports (phones in landscape): trim vertical padding so hero doesn't dominate the whole screen */
@media (max-height: 480px) and (orientation: landscape) {
	.hero { padding: 32px 0 28px; }
	section { padding: 32px 0; }
	.nav-row { padding: 10px 0; }
}

/* ---------- Article sub-headings (h4/h5), used on portfolio detail pages ---------- */
.main-col h4 {
	font-size: 22px;
	font-weight: 600;
	color: var(--text);
	margin: 32px 0 14px;
}
.main-col h5 {
	font-size: 16px;
	font-weight: 600;
	color: var(--text);
	margin: 28px 0 10px;
}
.main-col figure { margin: 24px 0; text-align: center; }
.main-col figure img { border-radius: 8px; border: 1px solid var(--border); }
.main-col figcaption { font-size: 13px; color: var(--text-dimmer); margin-top: 10px; }

/* ---------- Stat cards (portfolio data summaries) ---------- */
.stat-grid { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; }
.stat-group {
	flex: 1 1 320px;
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: 10px;
	padding: 16px;
}
.stat-group.total { background: var(--panel-2, #2A2436); }
.stat-group-title { font-weight: 600; color: var(--text); margin-bottom: 12px; }
.stat-row-wrap { display: flex; flex-wrap: wrap; gap: 10px; }
.stat-card {
	flex: 1 1 140px;
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: 8px;
	padding: 12px;
}
.stat-card-title { font-weight: 600; color: var(--text); margin-bottom: 8px; font-size: 14px; }
.stat-row { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--text-dim); padding: 2px 0; }

.nav-dropdown {
	position: relative;
	display: inline-block;
}

.nav-dropdown-menu {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	background: #17131d;
	border: 1px solid #342a45;
	min-width: 180px;
	padding: 10px 0;
	z-index: 1000;
}

.nav-dropdown-menu a {
	display: block;
	padding: 8px 15px;
	white-space: nowrap;
}

.nav-dropdown-menu a:hover {
	background: #241d30;
}

.nav-dropdown:hover .nav-dropdown-menu {
	display: block;
}