/* === reset & base === */
*,
*::before,
*::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

:root {
	/* warm dark palette */
	--bg: #1a1510;
	--bg-section: #211b14;
	--bg-card: #2a2118;
	--bg-card-hover: #322820;
	--bg-input: #241e16;
	--border: #3d3022;
	--border-light: #4e3d28;

	/* text */
	--text-primary: #e8d8be;
	--text-secondary: #b09070;
	--text-muted: #7a6048;

	/* accent — amber/copper */
	--accent: #c87d2a;
	--accent-bright: #e8962e;
	--accent-dim: #8a5218;
	--accent-glow: rgba(200, 125, 42, 0.18);

	/* status */
	--success: #5a9a5a;
	--error: #c05050;

	/* type */
	--font-sans: 'Ubuntu Sans', system-ui, -apple-system, sans-serif;
	--font-mono: 'Consolas', 'Menlo', monospace;

	/* spacing / radii */
	--radius-sm: 4px;
	--radius: 8px;
	--radius-lg: 14px;
	--max-w: 1140px;
}

html {
	scroll-behavior: smooth;
	font-size: 16px;
}

body {
	font-family: var(--font-sans);
	background: var(--bg);
	color: var(--text-primary);
	line-height: 1.65;
	overflow-x: hidden;
}

a {
	color: var(--accent-bright);
	text-decoration: none;
	transition: color .2s;
}

a:hover {
	color: var(--text-primary);
}

img,
svg {
	display: block;
}

/* === scrollbar === */
::-webkit-scrollbar {
	width: 6px;
}

::-webkit-scrollbar-track {
	background: var(--bg);
}

::-webkit-scrollbar-thumb {
	background: var(--accent-dim);
	border-radius: 3px;
}

/* === utility === */
.container {
	max-width: var(--max-w);
	margin: 0 auto;
	padding: 0 clamp(20px, 5vw, 60px);
}

.section {
	padding: clamp(72px, 10vw, 120px) 0;
}

.section-dark {
	background: var(--bg-section);
}

.section-header {
	text-align: center;
	margin-bottom: clamp(48px, 7vw, 80px);
}

.section-tag {
	display: inline-block;
	font-size: .75rem;
	font-weight: 700;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--accent);
	margin-bottom: 12px;
}

.section-title {
	font-size: clamp(1.8rem, 4vw, 2.8rem);
	font-weight: 700;
	color: var(--text-primary);
	line-height: 1.2;
	letter-spacing: -.02em;
}

.section-sub {
	margin-top: 16px;
	color: var(--text-secondary);
	font-size: 1.05rem;
	max-width: 580px;
	margin-left: auto;
	margin-right: auto;
}

/* === buttons === */
.btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 13px 28px;
	border-radius: var(--radius);
	font-size: .95rem;
	font-weight: 600;
	cursor: pointer;
	transition: all .2s;
	border: none;
	text-decoration: none;
	white-space: nowrap;
}

.btn-primary {
	background: var(--accent);
	color: #fff;
}

.btn-primary:hover {
	background: var(--accent-bright);
	color: #fff;
	transform: translateY(-1px);
	box-shadow: 0 6px 24px rgba(200, 125, 42, .35);
}

.btn-ghost {
	background: transparent;
	color: var(--text-primary);
	border: 1.5px solid var(--border-light);
}

.btn-ghost:hover {
	border-color: var(--accent);
	color: var(--accent-bright);
	transform: translateY(-1px);
}

/* === nav === */
.nav {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	z-index: 100;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 24px clamp(20px, 5vw, 60px);
}

.nav-brand {
	display: flex;
	align-items: baseline;
	gap: 2px;
	font-weight: 700;
	font-size: 1.15rem;
	letter-spacing: -.01em;
	user-select: none;
}

.brand-nine {
	color: var(--accent-bright);
	font-size: 1.6rem;
	line-height: 1;
}

.brand-th {
	color: var(--accent);
	font-size: .75rem;
	vertical-align: super;
	margin: 0 2px 10px 0;
}

.brand-street {
	color: var(--text-secondary);
	font-size: 1rem;
}

.brand-codewerx {
	color: var(--text-primary);
	font-size: 1.1rem;
	margin-left: 4px;
	font-family: var(--font-sans);
}

.nav-links {
	list-style: none;
	display: flex;
	gap: 36px;
}

.nav-links a {
	color: var(--text-secondary);
	font-size: .9rem;
	font-weight: 500;
	letter-spacing: .02em;
	transition: color .2s;
}

.nav-links a:hover {
	color: var(--text-primary);
}

.nav-cta {
	color: var(--accent-bright) !important;
	border: 1px solid var(--accent-dim);
	padding: 6px 16px;
	border-radius: var(--radius-sm);
	transition: all .2s !important;
}

.nav-cta:hover {
	background: var(--accent-glow) !important;
	border-color: var(--accent) !important;
}

.nav-toggle {
	display: none;
	flex-direction: column;
	gap: 5px;
	background: none;
	border: none;
	cursor: pointer;
	padding: 4px;
}

.nav-toggle span {
	display: block;
	width: 24px;
	height: 2px;
	background: var(--text-primary);
	border-radius: 2px;
	transition: all .25s;
}

/* === hero === */
.hero {
	position: relative;
	min-height: 100vh;
	display: flex;
	align-items: center;
	overflow: hidden;
	background: var(--bg);
}

#neuron-canvas {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	opacity: .7;
}

.hero-overlay {
	position: absolute;
	inset: 0;
	/* warm vignette from bottom */
	background:
		radial-gradient(ellipse 80% 50% at 50% 110%, rgba(30, 18, 6, .95) 0%, transparent 70%),
		radial-gradient(ellipse 60% 60% at 50% 50%, rgba(26, 21, 16, .4) 0%, transparent 80%);
}

.hero-content {
	position: relative;
	z-index: 10;
	max-width: 700px;
	padding: 0 clamp(20px, 5vw, 60px);
	padding-top: 100px;
}

.hero-eyebrow {
	font-size: .8rem;
	font-weight: 600;
	letter-spacing: .18em;
	text-transform: uppercase;
	color: var(--accent);
	margin-bottom: 20px;
	opacity: 0;
	animation: fadeUp .7s .3s forwards;
}

.hero-title {
	display: flex;
	flex-direction: column;
	font-size: clamp(2.6rem, 7vw, 5.2rem);
	font-weight: 800;
	line-height: 1.05;
	letter-spacing: -.03em;
	margin-bottom: 24px;
}

.title-line {
	opacity: 0;
	animation: fadeUp .7s .45s forwards;
}

.title-line.accent {
	color: var(--accent-bright);
	animation-delay: .55s;
}

.hero-sub {
	font-size: clamp(.95rem, 2vw, 1.15rem);
	color: var(--text-secondary);
	max-width: 520px;
	margin-bottom: 36px;
	opacity: 0;
	animation: fadeUp .7s .7s forwards;
}

.hero-actions {
	display: flex;
	gap: 14px;
	flex-wrap: wrap;
	opacity: 0;
	animation: fadeUp .7s .85s forwards;
}

.hero-scroll-hint {
	position: absolute;
	bottom: 32px;
	left: clamp(20px, 5vw, 60px);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	z-index: 10;
	opacity: 0;
	animation: fadeIn 1s 1.4s forwards;
}

.hero-scroll-hint span {
	font-size: .65rem;
	letter-spacing: .18em;
	text-transform: uppercase;
	color: var(--text-muted);
	writing-mode: vertical-rl;
}

.scroll-line {
	width: 1px;
	height: 48px;
	background: linear-gradient(to bottom, var(--accent-dim), transparent);
	animation: scrollPulse 2s 2s infinite;
}

/* === coffee steam animation === */
.coffee-steam {
	position: absolute;
	top: clamp(72px, 9vh, 108px);
	right: clamp(16px, 5vw, 64px);
	width: clamp(100px, 10vw, 148px);
	pointer-events: none;
	z-index: 3;
}

.coffee-steam svg {
	width: 100%;
	height: auto;
	overflow: visible;
}

/* each wisp draws itself upward then fades */
.cs-wisp {
	stroke-dasharray: 280;
	stroke-dashoffset: 280;
	opacity: 0;
	animation: cs-wisp-rise 10s ease-in-out infinite;
}

.cs-w1 {
	animation-delay: 0s;
}

.cs-w2 {
	animation-delay: 1.1s;
}

.cs-w3 {
	animation-delay: 2.2s;
}

@keyframes cs-wisp-rise {
	0% {
		stroke-dashoffset: 280;
		opacity: 0;
	}

	6% {
		opacity: 1;
	}

	44% {
		stroke-dashoffset: 0;
		opacity: 0.85;
	}

	60% {
		stroke-dashoffset: 0;
		opacity: 0;
	}

	100% {
		stroke-dashoffset: 0;
		opacity: 0;
	}
}

/* numeral 9 solidifies from the steam, then dissolves back */
.cs-nine {
	opacity: 0;
	filter: blur(20px);
	animation: cs-nine-form 10s ease-in-out infinite;
}

@keyframes cs-nine-form {

	0%,
	36% {
		opacity: 0;
		filter: blur(20px);
	}

	58% {
		opacity: 0.75;
		filter: blur(5px);
	}

	72% {
		opacity: 1;
		filter: blur(0.5px);
	}

	84% {
		opacity: 1;
		filter: blur(0px);
	}

	95% {
		opacity: 0;
		filter: blur(14px);
	}

	100% {
		opacity: 0;
		filter: blur(20px);
	}
}

/* === services === */
.services-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 24px;
}

.service-card {
	background: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	padding: 32px 28px;
	transition: border-color .25s, background .25s, transform .25s, box-shadow .25s;
	cursor: default;
	opacity: 0;
	transform: translateY(24px);
}

.service-card.visible {
	opacity: 1;
	transform: translateY(0);
	transition: opacity .5s ease, transform .5s ease,
		border-color .25s, background .25s, box-shadow .25s;
}

.service-card:hover {
	border-color: var(--accent-dim);
	background: var(--bg-card-hover);
	transform: translateY(-3px);
	box-shadow: 0 12px 40px rgba(0, 0, 0, .4), 0 0 0 1px var(--accent-dim);
}

.service-icon {
	width: 48px;
	height: 48px;
	color: var(--accent);
	margin-bottom: 20px;
}

.service-icon svg {
	width: 100%;
	height: 100%;
}

.service-card h3 {
	font-size: 1.1rem;
	font-weight: 600;
	color: var(--text-primary);
	margin-bottom: 10px;
	letter-spacing: -.01em;
}

.service-card p {
	font-size: .9rem;
	color: var(--text-secondary);
	line-height: 1.6;
}

/* === tech stack === */
.stack-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	gap: 16px;
}

.stack-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	background: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	padding: 28px 16px 20px;
	text-align: center;
	transition: border-color .2s, background .2s, transform .2s;
	cursor: default;
	opacity: 0;
	transform: scale(.92);
}

.stack-item.visible {
	opacity: 1;
	transform: scale(1);
	transition: opacity .45s ease, transform .45s ease,
		border-color .2s, background .2s;
}

.stack-item:hover {
	border-color: var(--accent);
	background: var(--bg-card-hover);
	transform: translateY(-4px) scale(1.03);
}

.stack-logo {
	width: 52px;
	height: 52px;
	color: var(--accent-bright);
}

.stack-logo svg {
	width: 100%;
	height: 100%;
}

.stack-name {
	font-size: .9rem;
	font-weight: 600;
	color: var(--text-primary);
}

.stack-years {
	font-size: .72rem;
	color: var(--accent);
	font-family: var(--font-mono);
	letter-spacing: .04em;
}

/* === stack animation === */
.stack-animation {
	margin-top: 56px;
	display: flex;
	align-items: center;
	gap: 48px;
}

.stack-tech-list {
	list-style: none;
	flex-shrink: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.stack-tech-list li {
	font-size: .9rem;
	color: var(--text-secondary);
	padding-left: 1.2em;
	position: relative;
}

.stack-tech-list li::before {
	content: '—';
	position: absolute;
	left: 0;
	color: var(--accent-dim);
}

.blocks-anim-svg {
	flex: 1;
	min-width: 0;
	height: auto;
	overflow: visible;
}

/* === about === */
.about-layout {
	display: grid;
	grid-template-columns: 1fr 340px;
	gap: 80px;
	align-items: center;
}

.about-text .section-tag {
	display: block;
	margin-bottom: 12px;
}

.about-text .section-title {
	text-align: left;
	margin-bottom: 24px;
}

.about-text p {
	color: var(--text-secondary);
	margin-bottom: 16px;
	font-size: 1rem;
	line-height: 1.75;
}

.about-stats {
	display: flex;
	gap: 40px;
	margin-top: 40px;
	padding-top: 32px;
	border-top: 1px solid var(--border);
}

.stat {
	display: flex;
	flex-direction: column;
}

.stat-wrapper {
	display: flex;
	flex-direction: row;
}

.stat-number {
	font-size: 2.4rem;
	font-weight: 800;
	color: var(--accent-bright);
	line-height: 1;
	font-family: var(--font-mono);
}

.stat-suffix {
	font-size: 1.4rem;
	font-weight: 700;
	color: var(--accent);
	display: inline;
}

.stat-label {
	font-size: .8rem;
	color: var(--text-muted);
	text-transform: uppercase;
	letter-spacing: .1em;
	margin-top: 6px;
}

/* bulb visual */
.about-visual {
	display: flex;
	align-items: center;
	justify-content: center;
}

.bulb-wrapper {
	position: relative;
	width: 240px;
}

.bulb-svg {
	width: 100%;
	filter: drop-shadow(0 0 30px rgba(255, 180, 60, .25));
	animation: bulbFloat 5s ease-in-out infinite;
}

.bulb-rays line {
	animation: rayFlicker 3s ease-in-out infinite;
}

.bulb-rays line:nth-child(2) {
	animation-delay: .2s;
}

.bulb-rays line:nth-child(3) {
	animation-delay: .4s;
}

.bulb-rays line:nth-child(4) {
	animation-delay: .1s;
}

.bulb-rays line:nth-child(5) {
	animation-delay: .3s;
}

.bulb-rays line:nth-child(6) {
	animation-delay: .5s;
}

.bulb-rays line:nth-child(7) {
	animation-delay: .15s;
}

/* === contact === */
.contact-layout {
	display: grid;
	grid-template-columns: 1fr 280px;
	gap: 72px;
	align-items: start;
}

.contact-form {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.form-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
}

.form-group {
	display: flex;
	flex-direction: column;
	gap: 7px;
}

.form-group label {
	font-size: .8rem;
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--text-secondary);
}

.form-group input,
.form-group textarea {
	background: var(--bg-input);
	border: 1.5px solid var(--border);
	border-radius: var(--radius);
	padding: 12px 16px;
	font-size: .95rem;
	font-family: var(--font-sans);
	color: var(--text-primary);
	transition: border-color .2s, box-shadow .2s;
	resize: vertical;
	outline: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
	color: var(--text-muted);
}

.form-group input:focus,
.form-group textarea:focus {
	border-color: var(--accent);
	box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group input.invalid,
.form-group textarea.invalid {
	border-color: var(--error);
}

.field-error {
	font-size: .78rem;
	color: var(--error);
	min-height: 1em;
}

.btn-submit {
	align-self: flex-start;
	position: relative;
	min-width: 160px;
	justify-content: center;
}

.btn-spinner {
	display: none;
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, .3);
	border-top-color: #fff;
	border-radius: 50%;
	animation: spin .7s linear infinite;
}

.btn-submit.loading .btn-text {
	opacity: 0;
}

.btn-submit.loading .btn-spinner {
	display: block;
	position: absolute;
}

.form-status {
	font-size: .9rem;
	padding: 10px 14px;
	border-radius: var(--radius-sm);
	display: none;
}

.form-status.success {
	display: block;
	background: rgba(90, 154, 90, .12);
	border: 1px solid rgba(90, 154, 90, .3);
	color: #8aca8a;
}

.form-status.error {
	display: block;
	background: rgba(192, 80, 80, .12);
	border: 1px solid rgba(192, 80, 80, .3);
	color: #e08888;
}

.contact-info {
	display: flex;
	flex-direction: column;
	gap: 28px;
	padding-top: 8px;
}

.contact-item {
	display: flex;
	align-items: flex-start;
	gap: 14px;
}

.contact-item svg {
	width: 22px;
	height: 22px;
	color: var(--accent);
	flex-shrink: 0;
	margin-top: 2px;
}

.contact-item > div {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.contact-label {
	font-size: .75rem;
	text-transform: uppercase;
	letter-spacing: .1em;
	color: var(--text-muted);
}

.contact-item a,
.contact-item span:not(.contact-label) {
	font-size: .95rem;
	color: var(--text-secondary);
}

/* === footer === */
.footer {
	background: var(--bg);
	border-top: 1px solid var(--border);
	padding: 36px 0;
	text-align: center;
}

.footer-brand {
	display: inline-flex;
	align-items: baseline;
	gap: 2px;
	font-weight: 700;
	margin-bottom: 10px;
}

.footer-copy {
	font-size: .8rem;
	color: var(--text-muted);
}

/* === animations === */
@keyframes fadeUp {
	from {
		opacity: 0;
		transform: translateY(20px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes fadeIn {
	from {
		opacity: 0;
	}

	to {
		opacity: 1;
	}
}

@keyframes scrollPulse {

	0%,
	100% {
		transform: scaleY(1);
		opacity: 1;
	}

	50% {
		transform: scaleY(.6);
		opacity: .4;
	}
}

@keyframes bulbFloat {

	0%,
	100% {
		transform: translateY(0);
	}

	50% {
		transform: translateY(-10px);
	}
}

@keyframes rayFlicker {

	0%,
	100% {
		opacity: .6;
	}

	50% {
		opacity: .25;
	}
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

/* === responsive === */
@media (max-width: 900px) {
	.about-layout {
		grid-template-columns: 1fr;
		gap: 48px;
	}

	.about-visual {
		order: -1;
	}

	.bulb-wrapper {
		width: 180px;
	}

	.contact-layout {
		grid-template-columns: 1fr;
		gap: 48px;
	}

	.contact-info {
		flex-direction: row;
		flex-wrap: wrap;
	}
}

@media (max-width: 700px) {
	.nav-links {
		display: none;
	}

	.nav-links.open {
		display: flex;
		flex-direction: column;
		position: fixed;
		inset: 0;
		background: var(--bg-section);
		justify-content: center;
		align-items: center;
		gap: 32px;
		z-index: 200;
	}

	.nav-links.open a {
		font-size: 1.4rem;
	}

	.nav-toggle {
		display: flex;
		z-index: 300;
	}

	.nav-toggle.open span:nth-child(1) {
		transform: rotate(45deg) translate(5px, 5px);
	}

	.nav-toggle.open span:nth-child(2) {
		opacity: 0;
	}

	.nav-toggle.open span:nth-child(3) {
		transform: rotate(-45deg) translate(5px, -5px);
	}

	.form-row {
		grid-template-columns: 1fr;
	}

	.about-stats {
		gap: 24px;
		flex-wrap: wrap;
	}

	.stack-grid {
		grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
	}

	.hero-title {
		font-size: clamp(2.2rem, 11vw, 3rem);
	}
}

@media (prefers-reduced-motion: reduce) {

	*,
	*::before,
	*::after {
		animation-duration: .01ms !important;
		transition-duration: .01ms !important;
	}

	.service-card,
	.stack-item {
		opacity: 1;
		transform: none;
	}
}