/*
Theme Name:   Codehounds
Theme URI:    https://codehounds.com
Description:  Dark, terminal-inspired child theme for GeneratePress. Built for the Codehounds agency: front-end design, WordPress plugin development, PHP/JS, AI imagery and hosting. Ships with a custom front page and Gravity Forms / Gravity Wiz styling.
Author:       Codehounds
Author URI:   https://codehounds.com
Template:     generatepress
Version:      1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License:      GNU General Public License v2 or later
License URI:  https://www.gnu.org/licenses/gpl-2.0.html
Text Domain:  codehounds
Tags:         dark, one-column, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* ==========================================================================
   1. Design tokens
   ========================================================================== */
:root {
	--ch-bg:        #0d0a08;
	--ch-bg-2:      #130f0c;
	--ch-surface:   #1a140f;
	--ch-surface-2: #261d16;
	--ch-line:      rgba(200, 160, 120, .14);
	--ch-line-hi:   rgba(242, 130, 22, .45);
	--ch-text:      #eadfd3;
	--ch-heading:   #ffffff;
	--ch-muted:     #a8967f;
	--ch-accent:      #f28216;
	--ch-accent-2:     #ffa94d;
	--ch-brown:    #8a7260;
	--ch-danger:      #ff5d5d;
	--ch-amber:     #ffc857;
	--ch-radius:    12px;
	--ch-font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--ch-font-head: "Space Grotesk", "Inter", system-ui, sans-serif;
	--ch-font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "DejaVu Sans Mono", monospace;

	/* Re-map GeneratePress colour variables */
	--contrast:   var(--ch-heading);
	--contrast-2: var(--ch-text);
	--contrast-3: var(--ch-muted);
	--base:       var(--ch-surface);
	--base-2:     var(--ch-bg-2);
	--base-3:     var(--ch-bg);
	--accent:     var(--ch-accent);
}

/* ==========================================================================
   2. Base
   ========================================================================== */
html { scroll-behavior: smooth; }

body {
	background: var(--ch-bg);
	color: var(--ch-text);
	font-family: var(--ch-font-sans);
	font-size: 17px;
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
}

body::before { /* faint global grid */
	content: "";
	position: fixed;
	inset: 0;
	z-index: -1;
	background-image:
		linear-gradient(var(--ch-line) 1px, transparent 1px),
		linear-gradient(90deg, var(--ch-line) 1px, transparent 1px);
	background-size: 56px 56px;
	-webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 75%);
	mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 75%);
	opacity: .55;
}

::selection { background: var(--ch-accent); color: #1a0c02; }

h1, h2, h3, h4, h5, h6 {
	font-family: var(--ch-font-head);
	color: var(--ch-heading);
	letter-spacing: -.02em;
	font-weight: 700;
}

a { color: var(--ch-accent); text-decoration: none; transition: color .2s, text-shadow .2s; }
a:hover, a:focus { color: var(--ch-accent-2); text-shadow: 0 0 14px rgba(255, 169, 77, .45); }

hr { background: var(--ch-line); border: 0; height: 1px; }

code, kbd, samp, pre { font-family: var(--ch-font-mono); }
:not(pre) > code {
	background: var(--ch-surface-2);
	color: var(--ch-accent-2);
	padding: .15em .45em;
	border-radius: 6px;
	font-size: .88em;
	border: 1px solid var(--ch-line);
}
pre {
	tab-size: 4;
	background: #0a0806;
	color: var(--ch-text);
	border: 1px solid var(--ch-line);
	border-radius: var(--ch-radius);
	padding: 1.2rem 1.4rem;
	overflow-x: auto;
	font-size: .88rem;
	line-height: 1.65;
}

blockquote {
	border-left: 3px solid var(--ch-accent);
	background: var(--ch-surface);
	padding: 1rem 1.4rem;
	margin: 1.6em 0;
	border-radius: 0 var(--ch-radius) var(--ch-radius) 0;
	color: var(--ch-text);
}

table, th, td { border-color: var(--ch-line); }
th { background: var(--ch-surface-2); color: var(--ch-heading); }

/* Core form controls (non-Gravity Forms) */
input[type="text"], input[type="email"], input[type="url"], input[type="password"],
input[type="search"], input[type="tel"], input[type="number"], textarea, select {
	background: var(--ch-bg-2);
	color: var(--ch-text);
	border: 1px solid var(--ch-line);
	border-radius: 8px;
	font-family: var(--ch-font-mono);
	font-size: .92rem;
	transition: border-color .2s, box-shadow .2s;
}
input:focus, textarea:focus, select:focus {
	background: var(--ch-bg-2);
	color: var(--ch-heading);
	border-color: var(--ch-accent);
	box-shadow: 0 0 0 3px rgba(242, 130, 22, .15);
	outline: 0;
}
::placeholder { color: #6e5e4f; }

button, html input[type="button"], input[type="reset"], input[type="submit"], a.button, a.wp-block-button__link:not(.has-background) {
	background: linear-gradient(135deg, var(--ch-accent), var(--ch-accent-2));
	color: #1a0c02;
	font-family: var(--ch-font-mono);
	font-weight: 600;
	letter-spacing: .02em;
	border: 0;
	border-radius: 8px;
	transition: transform .15s, box-shadow .2s, filter .2s;
}
button:hover, html input[type="button"]:hover, input[type="reset"]:hover, input[type="submit"]:hover, a.button:hover,
a.wp-block-button__link:not(.has-background):hover {
	background: linear-gradient(135deg, var(--ch-accent), var(--ch-accent-2));
	color: #1a0c02;
	box-shadow: 0 0 28px rgba(242, 130, 22, .35);
	transform: translateY(-1px);
}

/* ==========================================================================
   3. GeneratePress chrome: header, nav, content, sidebar, footer
   ========================================================================== */
.site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: rgba(13, 10, 8, .72);
	-webkit-backdrop-filter: blur(14px) saturate(160%);
	backdrop-filter: blur(14px) saturate(160%);
	border-bottom: 1px solid var(--ch-line);
}
.admin-bar .site-header { top: 32px; }
.site-header .inside-header { padding-top: 14px; padding-bottom: 14px; align-items: center; }
.site-logo img, .header-image {
	width: 44px !important;
	height: 44px !important;
	max-height: 44px;
	flex: none;
	object-fit: cover;
	border-radius: 10px;
	border: 1px solid var(--ch-line);
	margin-right: 12px;
}
.site-branding-container, .inside-header .site-branding { display: flex; align-items: center; }
.main-title, .main-title a {
	font-family: var(--ch-font-mono);
	font-size: 1.15rem !important;
	font-weight: 700;
	color: var(--ch-heading);
	letter-spacing: -.02em;
}
.main-title a::before { content: "~/"; color: var(--ch-accent-2); margin-right: 2px; }
.main-title a::after  { content: "_"; color: var(--ch-accent); animation: ch-blink 1.1s steps(1) infinite; }
.site-description { color: var(--ch-muted); font-family: var(--ch-font-mono); font-size: .75rem; }

.main-navigation, .main-navigation ul ul, .main-navigation .main-nav ul li a { background: transparent; }
.main-navigation .main-nav ul li a {
	font-family: var(--ch-font-mono);
	font-size: .84rem;
	letter-spacing: .02em;
	color: var(--ch-muted);
	text-transform: lowercase;
}
.main-navigation .main-nav ul li:hover > a,
.main-navigation .main-nav ul li:focus > a,
.main-navigation .main-nav ul li.sfHover > a,
.main-navigation .main-nav ul li.menu-item-object-page.current-menu-item > a,
.main-navigation .main-nav ul li.is-active > a {
	color: var(--ch-accent);
	background: transparent;
	text-shadow: 0 0 12px rgba(242, 130, 22, .5);
}
.main-navigation .main-nav ul li a::before { content: "./"; color: var(--ch-accent-2); opacity: .6; }
.main-navigation ul ul {
	background: var(--ch-surface);
	border: 1px solid var(--ch-line);
	border-radius: 10px;
	box-shadow: 0 20px 50px rgba(0, 0, 0, .6);
}
.menu-toggle { color: var(--ch-accent); }

/* Content cards on inner pages / blog */
.separate-containers .inside-article,
.separate-containers .comments-area,
.separate-containers .page-header,
.one-container .container,
.separate-containers .paging-navigation,
.inside-page-header {
	background: var(--ch-surface);
	border: 1px solid var(--ch-line);
	border-radius: var(--ch-radius);
	color: var(--ch-text);
}
.one-container .container { background: transparent; border: 0; }
.entry-title a { color: var(--ch-heading); }
.entry-title a:hover { color: var(--ch-accent); }
.entry-meta, .entry-meta a, .entry-meta a:visited, .cat-links, .tags-links, .posted-on {
	color: var(--ch-muted);
	font-family: var(--ch-font-mono);
	font-size: .8rem;
}
.sidebar .widget, .footer-widgets .widget {
	background: var(--ch-surface);
	border: 1px solid var(--ch-line);
	border-radius: var(--ch-radius);
	color: var(--ch-text);
}
.widget-title { font-family: var(--ch-font-mono); font-size: .9rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ch-accent); }
.widget-title::before { content: "// "; color: var(--ch-accent-2); }
.paging-navigation a, .page-numbers { color: var(--ch-text); font-family: var(--ch-font-mono); }
.page-numbers.current { color: var(--ch-accent); }
.comment-body { border-color: var(--ch-line); }

.site-footer { background: var(--ch-bg-2); border-top: 1px solid var(--ch-line); }
.site-info { color: var(--ch-muted); font-family: var(--ch-font-mono); font-size: .82rem; }
.site-info a { color: var(--ch-text); }
.footer-widgets { background: transparent; }

@keyframes ch-blink { 50% { opacity: 0; } }

/* ==========================================================================
   4. Front page (front-page.php)
   ========================================================================== */
.home .site.grid-container,
.home .site-content,
.home .grid-container { max-width: 100%; }
.home .site-content { display: block; }
.home .site-header { max-width: none; }

.ch-wrap { width: min(1180px, 100% - 48px); margin-inline: auto; }
.ch-section { padding: 110px 0; position: relative; }
.ch-eyebrow {
	font-family: var(--ch-font-mono);
	font-size: .8rem;
	color: var(--ch-accent-2);
	letter-spacing: .14em;
	text-transform: uppercase;
	margin: 0 0 14px;
}
.ch-eyebrow::before { content: "// "; color: var(--ch-accent); }
.ch-section-title { font-size: clamp(2rem, 4vw, 3rem); line-height: 1.1; margin: 0 0 16px; }
.ch-section-lead { color: var(--ch-muted); max-width: 640px; margin: 0 0 56px; font-size: 1.05rem; }

/* Hero */
.ch-hero { padding: 96px 0 90px; overflow: hidden; }
.ch-hero::before, .ch-hero::after {
	content: ""; position: absolute; border-radius: 50%; filter: blur(90px); pointer-events: none; z-index: 0;
}
.ch-hero::before { width: 520px; height: 520px; left: -140px; top: -120px; background: rgba(242, 130, 22, .18); }
.ch-hero::after  { width: 480px; height: 480px; right: -120px; top: 80px; background: rgba(138, 114, 96, .2); }
.ch-hero-grid {
	display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; position: relative; z-index: 1;
}
.ch-badge {
	display: inline-flex; align-items: center; gap: 10px;
	font-family: var(--ch-font-mono); font-size: .78rem; color: var(--ch-text);
	padding: 7px 14px; border: 1px solid var(--ch-line); border-radius: 999px;
	background: rgba(38, 29, 22, .7); margin-bottom: 26px;
}
.ch-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ch-accent-2); box-shadow: 0 0 12px var(--ch-accent-2); animation: ch-pulse 2s infinite; }
@keyframes ch-pulse { 50% { opacity: .35; } }

.ch-hero h1 {
	font-size: clamp(2.6rem, 6vw, 4.6rem);
	line-height: 1.02;
	margin: 0 0 22px;
}
.ch-grad {
	background: linear-gradient(100deg, var(--ch-accent) 10%, var(--ch-accent-2) 55%, var(--ch-brown) 100%);
	-webkit-background-clip: text; background-clip: text; color: transparent;
}
.ch-hero p.ch-sub { font-size: 1.15rem; color: var(--ch-muted); max-width: 540px; margin-bottom: 34px; }
.ch-cta { display: flex; flex-wrap: wrap; gap: 14px; }
.ch-btn {
	display: inline-flex; align-items: center; gap: 10px;
	font-family: var(--ch-font-mono); font-size: .92rem; font-weight: 600;
	padding: 14px 24px; border-radius: 10px; line-height: 1;
	background: linear-gradient(135deg, var(--ch-accent), var(--ch-accent-2)); color: #1a0c02;
	box-shadow: 0 0 0 1px rgba(255, 255, 255, .06), 0 10px 40px rgba(242, 130, 22, .22);
	transition: transform .15s, box-shadow .2s;
}
.ch-btn:hover { color: #1a0c02; transform: translateY(-2px); box-shadow: 0 14px 50px rgba(242, 130, 22, .4); text-shadow: none; }
.ch-btn--ghost { background: transparent; color: var(--ch-text); border: 1px solid var(--ch-line-hi); box-shadow: none; }
.ch-btn--ghost:hover { color: var(--ch-accent); background: rgba(242, 130, 22, .07); box-shadow: none; }

.ch-hero-meta { display: flex; flex-wrap: wrap; gap: 28px; margin-top: 44px; font-family: var(--ch-font-mono); font-size: .8rem; color: var(--ch-muted); }
.ch-hero-meta b { color: var(--ch-heading); font-weight: 600; display: block; font-size: 1.15rem; }

/* Terminal window */
.ch-term {
	background: rgba(10, 8, 6, .88);
	border: 1px solid var(--ch-line);
	border-radius: 14px;
	box-shadow: 0 30px 80px rgba(0, 0, 0, .6), 0 0 0 1px rgba(242, 130, 22, .06), 0 0 80px rgba(242, 130, 22, .08);
	overflow: hidden;
	font-family: var(--ch-font-mono);
}
.ch-term-bar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; background: var(--ch-surface-2); border-bottom: 1px solid var(--ch-line); }
.ch-term-bar i { width: 11px; height: 11px; border-radius: 50%; display: block; background: #ff5f57; }
.ch-term-bar i:nth-child(2) { background: #febc2e; }
.ch-term-bar i:nth-child(3) { background: #28c840; }
.ch-term-bar span { margin-left: 10px; font-size: .75rem; color: var(--ch-muted); }
.ch-term-body { padding: 22px 22px 26px; font-size: .84rem; line-height: 1.85; color: var(--ch-text); min-height: 330px; }
.ch-term-body .ln { display: block; opacity: 0; animation: ch-line .01s forwards; }
.ch-term-body .ln:nth-child(1) { animation-delay: .3s; } .ch-term-body .ln:nth-child(2) { animation-delay: .9s; }
.ch-term-body .ln:nth-child(3) { animation-delay: 1.4s; } .ch-term-body .ln:nth-child(4) { animation-delay: 1.8s; }
.ch-term-body .ln:nth-child(5) { animation-delay: 2.2s; } .ch-term-body .ln:nth-child(6) { animation-delay: 2.6s; }
.ch-term-body .ln:nth-child(7) { animation-delay: 3s; }   .ch-term-body .ln:nth-child(8) { animation-delay: 3.4s; }
.ch-term-body .ln:nth-child(9) { animation-delay: 3.8s; }
@keyframes ch-line { to { opacity: 1; } }
.t-p { color: var(--ch-accent-2); } .t-c { color: var(--ch-accent); } .t-m { color: var(--ch-muted); }
.t-v { color: var(--ch-brown); } .t-a { color: var(--ch-amber); } .t-k { color: var(--ch-danger); }
.t-cursor { display: inline-block; width: 8px; height: 1em; background: var(--ch-accent-2); vertical-align: -2px; animation: ch-blink 1s steps(1) infinite; }

/* Stack marquee */
.ch-marquee { border-block: 1px solid var(--ch-line); background: rgba(19, 15, 12, .6); overflow: hidden; padding: 20px 0; }
.ch-marquee-track { display: flex; gap: 56px; width: max-content; animation: ch-scroll 38s linear infinite; font-family: var(--ch-font-mono); font-size: .9rem; color: var(--ch-muted); }
.ch-marquee-track span::before { content: "◆ "; color: var(--ch-accent); }
@keyframes ch-scroll { to { transform: translateX(-50%); } }

/* Services */
.ch-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.ch-card {
	position: relative;
	background: linear-gradient(180deg, rgba(38, 29, 22, .75), rgba(26, 20, 15, .75));
	border: 1px solid var(--ch-line);
	border-radius: var(--ch-radius);
	padding: 0;
	overflow: hidden;
	transition: transform .25s, border-color .25s, box-shadow .25s;
}
.ch-card::after {
	content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s;
	background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(242, 130, 22, .13), transparent 45%);
}
.ch-card:hover { transform: translateY(-4px); border-color: var(--ch-line-hi); box-shadow: 0 24px 60px rgba(0, 0, 0, .5), 0 0 40px rgba(242, 130, 22, .08); }
.ch-card:hover::after { opacity: 1; }
.ch-card-tab { font-family: var(--ch-font-mono); font-size: .7rem; color: var(--ch-muted); padding: 10px 18px; border-bottom: 1px solid var(--ch-line); background: rgba(10, 8, 6, .5); }
.ch-card-tab::before { content: "● "; color: var(--ch-accent-2); }
.ch-card-body { padding: 22px 20px 26px; }
.ch-icon { font-family: var(--ch-font-mono); font-size: 1.5rem; color: var(--ch-accent); text-shadow: 0 0 18px rgba(242, 130, 22, .6); margin-bottom: 14px; display: block; }
.ch-card h3 { font-size: 1.15rem; margin: 0 0 8px; }
.ch-card p { margin: 0; color: var(--ch-muted); font-size: .92rem; line-height: 1.6; }

/* Process */
.ch-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border: 1px solid var(--ch-line); border-radius: var(--ch-radius); overflow: hidden; background: var(--ch-surface); }
.ch-step { padding: 34px 28px; border-right: 1px solid var(--ch-line); }
.ch-step:last-child { border-right: 0; }
.ch-step-n { font-family: var(--ch-font-mono); font-size: 2.4rem; font-weight: 700; color: transparent; -webkit-text-stroke: 1px var(--ch-accent); display: block; margin-bottom: 10px; }
.ch-step h3 { font-family: var(--ch-font-mono); font-size: 1rem; color: var(--ch-accent-2); margin: 0 0 8px; }
.ch-step p { margin: 0; font-size: .92rem; color: var(--ch-muted); }

/* Code showcase */
.ch-split { display: grid; grid-template-columns: .9fr 1.1fr; gap: 56px; align-items: center; }
.ch-list { list-style: none; margin: 26px 0 0; padding: 0; font-family: var(--ch-font-mono); font-size: .92rem; }
.ch-list li { padding: 8px 0; color: var(--ch-text); }
.ch-list li::before { content: "$ "; color: var(--ch-accent-2); }
.ch-code { margin: 0; border: 0; background: transparent; padding: 22px; font-size: .8rem; line-height: 1.75; color: var(--ch-text); }

/* Contact */
.ch-contact {
	background: linear-gradient(180deg, transparent, rgba(242, 130, 22, .04));
	border-top: 1px solid var(--ch-line);
}
.ch-contact-card {
	max-width: 760px; margin: 0 auto; padding: 44px;
	background: rgba(26, 20, 15, .85); border: 1px solid var(--ch-line-hi); border-radius: 16px;
	box-shadow: 0 0 80px rgba(242, 130, 22, .1);
}
.ch-contact-card .ch-section-lead { margin-bottom: 30px; }
.ch-center { text-align: center; }
.ch-center .ch-section-lead { margin-inline: auto; }

/* Reveal on scroll (added by main.js; content stays visible without JS) */
.js .ch-reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s ease; }
.js .ch-reveal.is-in { opacity: 1; transform: none; }

/* ==========================================================================
   5. Responsive
   ========================================================================== */
@media (max-width: 1024px) {
	.ch-grid { grid-template-columns: repeat(2, 1fr); }
	.ch-steps { grid-template-columns: repeat(2, 1fr); }
	.ch-step:nth-child(2) { border-right: 0; }
	.ch-step:nth-child(-n+2) { border-bottom: 1px solid var(--ch-line); }
}
@media (max-width: 860px) {
	.ch-hero-grid, .ch-split { grid-template-columns: 1fr; gap: 40px; }
	.ch-section { padding: 76px 0; }
	.ch-contact-card { padding: 28px 22px; }
}
@media (max-width: 600px) {
	.ch-grid, .ch-steps { grid-template-columns: 1fr; }
	.ch-step { border-right: 0; border-bottom: 1px solid var(--ch-line); }
	.ch-step:last-child { border-bottom: 0; }
	.main-navigation .main-nav ul li a::before { content: ""; }
}
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
	.ch-term-body .ln { opacity: 1; }
	.js .ch-reveal { opacity: 1; transform: none; }
}

/* ==========================================================================
   6. Inner landing pages (About, etc.) – wrap page content in <div class="ch-page">
   ========================================================================== */
.inside-article:has(.ch-page) { background: transparent; border: 0; padding: 0; box-shadow: none; }
.inside-article:has(.ch-page) .entry-header { display: none; }
.inside-article:has(.ch-page) .entry-content { margin: 0; }
.ch-page .ch-section { padding: 70px 0; }
.ch-page .ch-page-hero { padding: 90px 0 30px; }
.ch-page h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.05; margin: 0 0 18px; }
.ch-grid--3 { grid-template-columns: repeat(3, 1fr); }
.ch-team { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.ch-member {
	background: linear-gradient(180deg, rgba(38, 29, 22, .75), rgba(26, 20, 15, .75));
	border: 1px solid var(--ch-line); border-radius: var(--ch-radius); padding: 30px 26px 28px;
	transition: transform .25s, border-color .25s, box-shadow .25s;
}
.ch-member:hover { transform: translateY(-4px); border-color: var(--ch-line-hi); box-shadow: 0 24px 60px rgba(0, 0, 0, .5), 0 0 40px rgba(242, 130, 22, .08); }
.ch-avatar {
	width: 84px; height: 84px; border-radius: 20px; display: grid; place-items: center; margin-bottom: 22px;
	font-family: var(--ch-font-mono); font-weight: 700; font-size: 1.7rem; color: #1a0c02;
	background: linear-gradient(135deg, var(--ch-accent), var(--ch-accent-2)); box-shadow: 0 0 40px rgba(242, 130, 22, .3);
}
.ch-member h3 { margin: 0 0 4px; font-size: 1.4rem; }
.ch-role { font-family: var(--ch-font-mono); font-size: .76rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ch-accent); margin: 0 0 16px; }
.ch-member p { margin: 0; color: var(--ch-muted); font-size: .95rem; line-height: 1.65; }
.ch-tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 20px 0 0; }
.ch-tags li { font-family: var(--ch-font-mono); font-size: .72rem; border: 1px solid var(--ch-line); border-radius: 999px; padding: 4px 11px; color: var(--ch-text); margin: 0; }
@media (max-width: 1024px) { .ch-grid--3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 860px) { .ch-team { grid-template-columns: 1fr; } .ch-page .ch-page-hero { padding-top: 60px; } }
@media (max-width: 600px) { .ch-grid--3 { grid-template-columns: 1fr; } }

/* ==========================================================================
   7. Light theme + theme toggle
   Dark is the default. <html data-theme="light"> swaps the palette.
   ========================================================================== */
:root { color-scheme: dark; }

/* Terminal / code windows stay dark in both themes. */
.ch-term {
	--ch-text: #eadfd3; --ch-heading: #ffffff; --ch-muted: #a8967f;
	--ch-line: rgba(200, 160, 120, .14); --ch-surface-2: #261d16;
	--ch-accent: #f28216; --ch-accent-2: #ffa94d; --ch-brown: #8a7260;
	--ch-danger: #ff5d5d; --ch-amber: #ffc857;
}

[data-theme="light"] {
	color-scheme: light;
	--ch-bg: #faf6f0;
	--ch-bg-2: #f3ece2;
	--ch-surface: #ffffff;
	--ch-surface-2: #f6eee3;
	--ch-line: rgba(104, 87, 71, .18);
	--ch-line-hi: rgba(200, 101, 10, .5);
	--ch-text: #43372d;
	--ch-heading: #1a120b;
	--ch-muted: #7a6857;
	--ch-accent: #c8650a;
	--ch-accent-2: #f28216;
	--ch-brown: #8a6a4f;
	--ch-danger: #d63a3a;
	--ch-amber: #b7791f;
}

[data-theme="light"] a:hover, [data-theme="light"] a:focus { color: #8f4400; text-shadow: none; }
[data-theme="light"] .ch-btn:hover, [data-theme="light"] .ch-btn:focus { color: #1a0c02; }
[data-theme="light"] ::placeholder { color: #a08f7c; }
[data-theme="light"] :not(pre) > code { color: #a14f00; }
[data-theme="light"] pre { color: #eadfd3; }
[data-theme="light"] body::before { opacity: .8; }
[data-theme="light"] .site-header { background: rgba(250, 246, 240, .8); }
[data-theme="light"] .main-navigation ul ul { box-shadow: 0 20px 50px rgba(60, 40, 20, .15); }
[data-theme="light"] .ch-eyebrow { color: #a14f00; }
[data-theme="light"] .ch-role { color: #a14f00; }
[data-theme="light"] .ch-hero::before { background: rgba(242, 130, 22, .16); }
[data-theme="light"] .ch-hero::after { background: rgba(138, 106, 79, .14); }
[data-theme="light"] .ch-badge { background: rgba(255, 255, 255, .75); }
[data-theme="light"] .ch-marquee { background: rgba(255, 255, 255, .6); }
[data-theme="light"] .ch-card,
[data-theme="light"] .ch-member { background: linear-gradient(180deg, #ffffff, #fbf5ec); box-shadow: 0 1px 2px rgba(60, 40, 20, .05); }
[data-theme="light"] .ch-card:hover,
[data-theme="light"] .ch-member:hover { box-shadow: 0 24px 60px rgba(60, 40, 20, .14), 0 0 40px rgba(242, 130, 22, .1); }
[data-theme="light"] .ch-card-tab { background: rgba(243, 236, 226, .8); }
[data-theme="light"] .ch-card::after { background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(242, 130, 22, .12), transparent 45%); }
[data-theme="light"] .ch-contact-card { background: rgba(255, 255, 255, .92); box-shadow: 0 20px 80px rgba(200, 101, 10, .12); }
[data-theme="light"] .ch-step h3 { color: var(--ch-accent); }
[data-theme="light"] .ch-icon { text-shadow: none; }
[data-theme="light"] .ch-btn--ghost { color: var(--ch-heading); }
[data-theme="light"] .ch-btn--ghost:hover { color: var(--ch-accent); }

/* Gravity Forms – light */
[data-theme="light"] .gform-theme--foundation,
[data-theme="light"] .gform-theme--framework,
[data-theme="light"] .gform_wrapper.gravity-theme,
[data-theme="light"] .gform_wrapper {
	--gf-color-primary: #c8650a;
	--gf-color-primary-rgb: 200, 101, 10;
	--gf-color-primary-darker: #a14f00;
	--gf-color-primary-lighter: #f28216;
	--gf-color-secondary: #f6eee3;
	--gf-color-secondary-contrast: #43372d;
	--gf-color-in-ctrl: #ffffff;
	--gf-color-in-ctrl-contrast: #43372d;
	--gf-color-in-ctrl-dark: #43372d;
	--gf-color-in-ctrl-light: #f6eee3;
	--gf-color-in-ctrl-primary: #c8650a;
	--gf-color-out-ctrl-dark: #43372d;
	--gf-color-out-ctrl-light: rgba(104, 87, 71, .18);
	--gf-ctrl-border-color: rgba(104, 87, 71, .28);
	--gf-ctrl-border-color-hover: rgba(200, 101, 10, .6);
	--gf-ctrl-border-color-focus: #c8650a;
	--gf-ctrl-bg-color: #ffffff;
	--gf-ctrl-color: #43372d;
	--gf-ctrl-label-color-primary: #1a120b;
	--gf-ctrl-label-color-secondary: #7a6857;
	--gf-ctrl-desc-color: #7a6857;
}
[data-theme="light"] .gform_wrapper input[type="text"],
[data-theme="light"] .gform_wrapper input[type="email"],
[data-theme="light"] .gform_wrapper input[type="url"],
[data-theme="light"] .gform_wrapper input[type="tel"],
[data-theme="light"] .gform_wrapper input[type="number"],
[data-theme="light"] .gform_wrapper input[type="password"],
[data-theme="light"] .gform_wrapper input[type="date"],
[data-theme="light"] .gform_wrapper textarea,
[data-theme="light"] .gform_wrapper select { background: #ffffff; border-color: rgba(104, 87, 71, .28); }
[data-theme="light"] .gform_wrapper .gform_validation_errors,
[data-theme="light"] .gform_wrapper .validation_error { background: rgba(214, 58, 58, .07); border-color: rgba(214, 58, 58, .5); color: #a31e1e; }
[data-theme="light"] .gform_wrapper .gfield_validation_message,
[data-theme="light"] .gform_wrapper .validation_message { color: #b42323; }
[data-theme="light"] .gform_confirmation_message,
[data-theme="light"] .gform_confirmation_wrapper { background: rgba(242, 130, 22, .1); border-color: rgba(200, 101, 10, .45); color: #8f4400; }

/* Theme toggle (sliding sun / moon switch) */
.ch-toggle {
	position: relative; display: inline-flex; align-items: center; margin: 0 4px 0 14px; padding: 0;
	background: none; border: 0; border-radius: 999px; line-height: 0; cursor: pointer; box-shadow: none; transform: none;
}
.ch-toggle:hover, .ch-toggle:focus { background: none; box-shadow: none; transform: none; }
.ch-toggle:focus-visible { outline: 2px solid var(--ch-accent); outline-offset: 3px; }
.ch-toggle-track {
	position: relative; display: block; width: 62px; height: 32px; border-radius: 999px;
	background: var(--ch-surface-2); border: 1px solid var(--ch-line-hi); transition: background .4s, border-color .4s;
}
.ch-toggle-track::before, .ch-toggle-track::after { /* faint "stars" / "rays" hints */
	content: ""; position: absolute; top: 50%; width: 3px; height: 3px; border-radius: 50%; background: var(--ch-muted); opacity: .6;
}
.ch-toggle-track::before { left: 13px; transform: translateY(-5px); }
.ch-toggle-track::after { left: 20px; transform: translateY(3px); }
[data-theme="light"] .ch-toggle-track::before { left: auto; right: 13px; }
[data-theme="light"] .ch-toggle-track::after { left: auto; right: 22px; }
.ch-toggle-thumb {
	position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
	background: linear-gradient(135deg, var(--ch-accent), var(--ch-accent-2));
	box-shadow: 0 0 14px rgba(242, 130, 22, .55); display: grid; place-items: center;
	transform: translateX(30px); transition: transform .5s cubic-bezier(.68, -.45, .27, 1.45);
}
[data-theme="light"] .ch-toggle-thumb { transform: none; }
.ch-toggle svg { position: absolute; width: 14px; height: 14px; color: #1a0c02; transition: opacity .3s, transform .5s; }
.ch-ico-sun { opacity: 0; transform: rotate(-90deg) scale(.4); }
[data-theme="light"] .ch-ico-sun { opacity: 1; transform: none; }
[data-theme="light"] .ch-ico-moon { opacity: 0; transform: rotate(90deg) scale(.4); }


/* Featured work: dieline illustration + 3-column services grid helpers */
.ch-dieline svg { display: block; width: 100%; height: auto; padding: 14px 18px 20px; }
@media (min-width: 601px) and (max-width: 1024px) {
	.ch-grid--3 .ch-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

/* ---- AI imagery gallery ---- */
.ch-gallery { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; margin-top: 40px; }
.ch-shot { position: relative; margin: 0; overflow: hidden; border: 1px solid var(--ch-line, rgba(242,130,22,.25)); border-radius: 12px; background: var(--ch-surface); grid-column: span 2; height: 300px; }
.ch-shot--wide { grid-column: span 4; height: 460px; }
.ch-shot--tall { grid-column: span 2; height: 460px; }
.ch-shot img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.ch-shot:hover img { transform: scale(1.05); }
.ch-shot figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 36px 16px 14px; font-family: "JetBrains Mono", monospace; font-size: 13px; color: #fff; background: linear-gradient(to top, rgba(13,10,8,.85), transparent); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.ch-shot figcaption span { color: #ffa94d; font-size: 12px; }
.ch-shot figcaption em { margin-left: auto; font-style: normal; font-size: 11px; padding: 2px 8px; border: 1px solid rgba(255,255,255,.4); border-radius: 99px; background: rgba(0,0,0,.35); }
@media (max-width: 900px) { .ch-gallery { grid-template-columns: repeat(2, 1fr); } .ch-shot, .ch-shot--tall { grid-column: span 1; height: 240px; } .ch-shot--wide { grid-column: span 2; height: 300px; } }
@media (max-width: 600px) { .ch-gallery { grid-template-columns: 1fr; } .ch-shot, .ch-shot--wide, .ch-shot--tall { grid-column: span 1; height: 260px; } .ch-shot--tall { height: 340px; } }

/* ---- Terminal lightbox ---- */
.ch-shot { cursor: zoom-in; }
.ch-shot:focus-visible { outline: 2px solid var(--ch-accent); outline-offset: 3px; }
.ch-shot::after { content: "$ open"; position: absolute; top: 12px; right: 12px; font: 12px "JetBrains Mono", monospace; color: #ffa94d; background: rgba(13,10,8,.75); border: 1px solid rgba(242,130,22,.5); padding: 3px 9px; border-radius: 6px; opacity: 0; transform: translateY(-4px); transition: opacity .25s, transform .25s; pointer-events: none; }
.ch-shot:hover::after, .ch-shot:focus-visible::after { opacity: 1; transform: none; }
.ch-lb-lock { overflow: hidden; }
.ch-lb { position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(6,4,3,.9); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: 0; transition: opacity .25s ease; font-family: "JetBrains Mono", monospace; }
.ch-lb[hidden] { display: none; }
.ch-lb.is-open { opacity: 1; }
.ch-lb.is-closing { opacity: 0; transition-delay: .2s; }
.ch-lb-win { width: min(1100px, 100%); max-height: 100%; display: flex; flex-direction: column; background: #0a0806; color: #eadfd3; border: 1px solid rgba(242,130,22,.55); border-radius: 12px; overflow: hidden; box-shadow: 0 0 0 1px rgba(242,130,22,.12), 0 0 60px rgba(242,130,22,.22), 0 30px 80px rgba(0,0,0,.7); transform: scale(.94) translateY(12px); transition: transform .35s cubic-bezier(.2,.9,.3,1.2); }
.ch-lb.is-open .ch-lb-win { transform: none; animation: ch-lb-boot .5s steps(6) 1; }
.ch-lb.is-closing .ch-lb-win { animation: ch-lb-off .42s ease-in forwards; }
@keyframes ch-lb-boot { 0% { filter: brightness(2.2); } 40% { filter: brightness(.7); } 100% { filter: none; } }
@keyframes ch-lb-off { 0% { transform: scale(1,1); filter: brightness(1); } 55% { transform: scale(1,.012); filter: brightness(2.5); } 100% { transform: scale(0,.004); filter: brightness(4); opacity: 0; } }
.ch-lb-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: #1a140f; border-bottom: 1px solid rgba(242,130,22,.25); font-size: 12px; color: #a8967f; }
.ch-lb-bar i { width: 11px; height: 11px; border-radius: 50%; background: #ff5d5d; flex: none; }
.ch-lb-bar i:nth-child(2) { background: #ffc857; }
.ch-lb-bar i:nth-child(3) { background: #3ddc84; }
.ch-lb-title { margin-left: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.ch-lb button { font: inherit; color: #ffa94d; background: transparent; border: 1px solid rgba(242,130,22,.45); border-radius: 6px; padding: 3px 10px; cursor: pointer; }
.ch-lb button:hover, .ch-lb button:focus-visible { background: #f28216; color: #0d0a08; outline: none; }
.ch-lb-log { padding: 12px 16px 4px; font-size: 13px; line-height: 1.6; min-height: 5.2em; color: #eadfd3; }
.ch-lb-line::after { content: ""; }
.ch-lb-line:last-child::after { content: "\2588"; margin-left: 4px; color: #f28216; animation: ch-lb-blink 1s steps(1) infinite; }
.ch-lb-ok { color: #3ddc84; }
@keyframes ch-lb-blink { 50% { opacity: 0; } }
.ch-lb-stage { position: relative; margin: 8px 16px; flex: 1 1 auto; min-height: 0; display: flex; justify-content: center; align-items: center; background: #050403; border: 1px solid rgba(242,130,22,.2); border-radius: 6px; overflow: hidden; height: min(62vh, 640px); }
.ch-lb-stage img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; display: block; clip-path: inset(0 0 100% 0); opacity: 0; }
.ch-lb-stage.is-in img { animation: ch-lb-reveal .7s ease-out forwards, ch-lb-flicker .7s steps(4) 1; }
@keyframes ch-lb-reveal { from { clip-path: inset(0 0 100% 0); opacity: 1; } to { clip-path: inset(0 0 0 0); opacity: 1; } }
@keyframes ch-lb-flicker { 0%,100% { filter: none; } 30% { filter: brightness(1.6) saturate(1.4); } 60% { filter: brightness(.8); } }
.ch-lb-scan { position: absolute; left: 0; right: 0; top: 0; height: 3px; background: #f28216; box-shadow: 0 0 18px 4px rgba(242,130,22,.8); opacity: 0; pointer-events: none; }
.ch-lb-stage.is-in .ch-lb-scan { animation: ch-lb-scan .7s ease-out forwards; }
@keyframes ch-lb-scan { 0% { top: 0; opacity: 1; } 95% { opacity: 1; } 100% { top: calc(100% - 3px); opacity: 0; } }
.ch-lb-stage::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0 2px, rgba(0,0,0,.12) 2px 3px); }
.ch-lb-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: space-between; align-items: center; padding: 6px 16px 14px; font-size: 12px; color: #a8967f; }
.ch-lb-nav { display: flex; gap: 8px; margin-left: auto; }
@media (max-width: 600px) { .ch-lb { padding: 8px; } .ch-lb-stage { margin: 6px 8px; height: min(52vh, 420px); } .ch-lb-log, .ch-lb-meta { padding-left: 10px; padding-right: 10px; } .ch-shot::after { display: none; } }
@media (prefers-reduced-motion: reduce) { .ch-lb, .ch-lb-win { transition: none; animation: none !important; } .ch-lb-stage.is-in img { animation: none; clip-path: none; opacity: 1; } .ch-lb-stage.is-in .ch-lb-scan { animation: none; } }


/* ---- Packaging sheets ---- */
.ch-gallery--sheets .ch-shot--sheet { background: #fff; border-color: rgba(242,130,22,.35); grid-column: span 2; height: 280px; }
.ch-gallery--sheets .ch-shot--half { grid-column: span 3; height: 380px; }
.ch-gallery--sheets .ch-shot img { object-fit: contain; background: #fff; }
.ch-gallery--sheets .ch-shot:hover img { transform: scale(1.03); }
@media (max-width: 900px) { .ch-gallery--sheets .ch-shot--sheet, .ch-gallery--sheets .ch-shot--half { grid-column: span 2; height: 300px; } }
@media (max-width: 600px) { .ch-gallery--sheets .ch-shot--sheet, .ch-gallery--sheets .ch-shot--half { grid-column: span 1; height: 240px; } }

/* Packaging sheets: six even tiles, three per row on desktop */
.ch-gallery--sheets .ch-shot--sheet { height: auto; aspect-ratio: 3 / 2; }

/* Services grid: a lone last card spans the full row */
@media (min-width: 1025px) { .ch-grid--3 > .ch-card:last-child:nth-child(3n+1) { grid-column: 1 / -1; } }

/* Header and footer span the same width on every page (GeneratePress boxes them at 1200px on inner pages) */
.site-header .grid-container,
.site-footer .grid-container,
.site-header.grid-container,
.site-footer.grid-container { max-width: 100%; }

/* On the home page WordPress marks every anchor link as "current"; only the section in view should glow (see main.js) */
.main-navigation .main-nav ul li.menu-item-home.current-menu-item:not(.is-active):not(:hover):not(:focus-within) > a {
	color: var(--ch-muted);
	text-shadow: none;
}

/* ---- Theme switch ripple ---- */
.ch-theming *, .ch-theming *::before, .ch-theming *::after {
	transition-property: background-color, color, border-color, fill, stroke, box-shadow, text-shadow, outline-color !important;
	transition-duration: .45s !important;
	transition-timing-function: ease-out !important;
	transition-delay: var(--ch-d, 0ms) !important;
}
.ch-ring { position: fixed; z-index: 99999; pointer-events: none; box-sizing: border-box; border-radius: 50%; border: 2px solid var(--ch-accent-2); opacity: .95; transform: translate(-50%, -50%) scale(0); will-change: transform, opacity; box-shadow: 0 0 34px 8px rgba(242, 130, 22, .45), inset 0 0 46px rgba(242, 130, 22, .28); transition: transform .65s linear, opacity .65s ease-in; }
.ch-ring.is-go { transform: translate(-50%, -50%) scale(1); opacity: 0; }
@media (prefers-reduced-motion: reduce) { .ch-ring { display: none; } }
