/*
Theme Name: Kava Child
Template: kava
Description: Kava Child Theme — Kristjan Sepp (custom rebuild, ACF-driven, no Crocoblock)
Version: 6.0
*/

/* ============================================================
   TOKENS
   ============================================================ */
#ks-site {
	--bg:      #0b0f0d;
	--bg-2:    #10161300;
	--surface: #121a16;
	--surface-2: #16201b;
	--line:    rgba(255,255,255,.09);
	--line-2:  rgba(255,255,255,.16);
	--text:    #eef2ec;
	--muted:   #9aa79f;
	--accent:  #c7f24a;
	--accent-soft: rgba(199,242,74,.14);
	--evergreen: #4ea587;

	--serif: 'Space Grotesk', 'Inter', sans-serif;
	--sans:  'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
	--mono:  'Space Mono', ui-monospace, monospace;

	--maxw: 1140px;
	--pad: clamp(20px, 5vw, 40px);
}

/* ============================================================
   RESET (scoped)
   ============================================================ */
#ks-site, #ks-site * { box-sizing: border-box; }
#ks-site {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--sans);
	font-size: 16px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	overflow-x: hidden;
}
body.ks-page { margin: 0; background: var(--bg); }
#ks-site p { margin: 0 0 1.1em; }
#ks-site a { color: inherit; text-decoration: none; }
#ks-site img { max-width: 100%; display: block; }
#ks-site h1, #ks-site h2, #ks-site h3 { margin: 0; font-weight: 600; line-height: 1.08; }

.ks-wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding-left: var(--pad); padding-right: var(--pad); }

/* shared bits */
.ks-eyebrow {
	font-family: var(--mono);
	font-size: 12px;
	letter-spacing: .22em;
	text-transform: uppercase;
	color: var(--muted);
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 22px;
}
.ks-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 14px var(--accent); }

.ks-h2 {
	font-family: var(--serif);
	font-size: clamp(30px, 4.6vw, 52px);
	letter-spacing: -.02em;
	font-weight: 600;
}

.ks-btn {
	display: inline-flex; align-items: center; gap: 9px;
	background: var(--accent); color: #0c120a;
	font-family: var(--mono); font-weight: 700; font-size: 13px;
	letter-spacing: .04em; text-transform: uppercase;
	padding: 15px 26px; border-radius: 100px; border: 0; cursor: pointer;
	transition: transform .25s cubic-bezier(.16,1,.3,1), box-shadow .25s ease, background .25s ease;
}
.ks-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(199,242,74,.28); }
.ks-btn--sm { padding: 11px 20px; font-size: 12px; }
.ks-link {
	font-family: var(--mono); font-size: 13px; letter-spacing: .04em; text-transform: uppercase;
	color: var(--text); border-bottom: 1px solid var(--line-2); padding-bottom: 3px; transition: color .25s, border-color .25s;
}
.ks-link:hover { color: var(--accent); border-color: var(--accent); }

/* ============================================================
   HEADER
   ============================================================ */
.ks-header {
	position: fixed; top: 0; left: 0; right: 0; z-index: 100;
	transition: background .3s ease, border-color .3s ease, backdrop-filter .3s ease;
	border-bottom: 1px solid transparent;
}
.ks-header.is-scrolled {
	background: rgba(11,15,13,.82);
	backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
	border-bottom-color: var(--line);
}
.ks-header__inner { display: flex; align-items: center; gap: 28px; height: 76px; }
.ks-logo {
	font-family: var(--mono); font-weight: 700; font-size: 16px;
	letter-spacing: .14em; color: var(--text);
}
.ks-nav { display: flex; gap: 30px; margin-left: auto; }
.ks-nav a {
	font-size: 14px; font-weight: 500; color: var(--muted);
	position: relative; transition: color .2s;
}
.ks-nav a::after {
	content: ''; position: absolute; left: 0; bottom: -6px; height: 1px; width: 0; background: var(--accent); transition: width .3s cubic-bezier(.16,1,.3,1);
}
.ks-nav a:hover { color: var(--text); }
.ks-nav a:hover::after { width: 100%; }
.ks-header .ks-btn--sm { margin-left: 4px; }
.ks-burger { display: none; }

/* ============================================================
   HERO
   ============================================================ */
.ks-hero { position: relative; padding: 150px 0 90px; overflow: hidden; }
.ks-hero__bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.ks-hero__bg::before {
	content: ''; position: absolute; top: -20%; right: -10%; width: 60vw; height: 60vw; max-width: 760px; max-height: 760px;
	background: radial-gradient(circle, rgba(199,242,74,.16), transparent 62%);
	filter: blur(10px);
}
.ks-hero__bg::after {
	content: ''; position: absolute; inset: 0;
	background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
	background-size: 64px 64px;
	-webkit-mask-image: radial-gradient(circle at 70% 30%, #000, transparent 72%);
	mask-image: radial-gradient(circle at 70% 30%, #000, transparent 72%);
	opacity: .5;
}
.ks-hero__grid {
	position: relative; z-index: 1;
	display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center;
}
.ks-hero__title {
	font-family: var(--serif); font-weight: 600;
	font-size: clamp(52px, 8.5vw, 104px); line-height: .98; letter-spacing: -.035em;
	margin: 0 0 26px;
}
.ks-hero__intro { font-size: clamp(17px, 2vw, 20px); color: var(--muted); max-width: 30em; margin-bottom: 34px; }
.ks-hero__cta { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }

.ks-hero__photo { position: relative; }
.ks-portrait {
	position: relative; width: 100%; max-width: 380px; margin-left: auto;
	border: 1px solid var(--line-2); border-radius: 6px; padding: 12px; background: var(--surface);
}
.ks-portrait img {
	width: 100%; height: 460px; object-fit: cover; object-position: center 18%;
	border-radius: 3px; filter: grayscale(.15) contrast(1.02);
}
.ks-portrait::before {
	content: ''; position: absolute; top: -14px; right: -14px; width: 90px; height: 90px;
	border: 1px solid var(--accent); opacity: .55; border-radius: 4px; z-index: -1;
}
.ks-portrait::after {
	content: ''; position: absolute; bottom: -16px; left: -16px; width: 64px; height: 64px;
	background: var(--accent); opacity: .12; border-radius: 4px; z-index: -1;
}

/* ===========================================================
   STATS
   ========================================================== */
.ks-stats { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); }
.ks-stats__grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.ks-stat { padding: 46px 28px; border-right: 1px solid var(--line); }
.ks-stat:last-child { border-right: 0; }
.ks-stat__num {
	font-family: var(--serif); font-weight: 600; font-size: clamp(36px, 4.4vw, 56px);
	line-height: 1; letter-spacing: -.02em; color: var(--text); margin-bottom: 12px;
}
.ks-stat__label { font-family: var(--mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); line-height: 1.5; }

/* ===========================================================
   ABOUT
   =========================================================== */
.ks-about { padding: clamp(70px, 11vw, 130px) 0; }
.ks-about__grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 56px; }
.ks-about__body p { font-size: 17px; color: #c4cdc6; }
.ks-about__body p:last-child { margin-bottom: 0; }
.ks-about__body p:last-child {
	margin-top: 26px; padding: 24px 26px; border-left: 2px solid var(--accent);
	background: var(--accent-soft); border-radius: 0 8px 8px 0; color: #dbe6da; font-size: 16px;
}

/* ============================================================
   QUOTE
   =========================================================== */
.ks-quote { padding: clamp(50px, 8vw, 90px) 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: center; }
.ks-quote__text {
	font-family: var(--serif); font-weight: 400; font-style: italic;
	font-size: clamp(24px, 3.8vw, 40px); line-height: 1.28; letter-spacing: -.01em;
	max-width: 18em; margin: 0 auto 22px;
}
.ks-quote__author { font-family: var(--mono); font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); }

/* ============================================================
   SERVICES
   =========================================================== */
.ks-services { padding: clamp(70px, 11vw, 130px) 0; }
.ks-section__head { margin-bottom: 52px; max-width: 22em; }
.ks-services__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.ks-card {
	position: relative; padding: 38px 34px; border: 1px solid var(--line); border-radius: 12px;
	background: var(--surface); overflow: hidden;
	transition: transform .4s cubic-bezier(.16,1,.3,1), border-color .4s ease, background .4s ease;
}
.ks-card::before {
	content: ''; position: absolute; inset: 0; opacity: 0;
	background: radial-gradient(420px circle at var(--mx,50%) 0, var(--accent-soft), transparent 60%);
	transition: opacity .4s ease; pointer-events: none;
}
.ks-card:hover { transform: translateY(-6px); border-color: var(--line-2); background: var(--surface-2); }
.ks-card:hover::before { opacity: 1; }
.ks-card__num { font-family: var(--mono); font-size: 13px; color: var(--accent); letter-spacing: .1em; }
.ks-card__title { font-family: var(--serif); font-size: 24px; font-weight: 600; letter-spacing: -.01em; margin: 16px 0 12px; }
.ks-card__text { color: var(--muted); font-size: 15.5px; margin: 0; }

/* ============================================================
   CONTACT
   =========================================================== */
.ks-contact { padding: clamp(70px, 11vw, 130px) 0 clamp(60px, 9vw, 110px); text-align: center; position: relative; }
.ks-contact__head { max-width: 40em; margin: 0 auto; }
.ks-contact .ks-eyebrow { justify-content: center; }
.ks-contact__title { margin-bottom: 18px; }
.ks-contact__lead { color: var(--muted); font-size: 18px; }
.ks-contact__email {
	display: inline-block; font-family: var(--serif); font-weight: 600;
	font-size: clamp(26px, 5vw, 48px); letter-spacing: -.03em; margin: 38px 0 44px;
	color: var(--text); position: relative;
}
.ks-contact__email::after { content: ''; position: absolute; left: 0; bottom: 4px; height: 2px; width: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .4s cubic-bezier(.16,1,.3,1); }
.ks-contact__email:hover { color: var(--accent); }
.ks-contact__email:hover::after { transform: scaleX(1); }
.ks-contact__meta { display: flex; justify-content: center; gap: 56px; flex-wrap: wrap; }
.ks-contact__item { display: flex; flex-direction: column; gap: 7px; }
.ks-contact__k { font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.ks-contact__item a:hover { color: var(--accent); }

/* ============================================================
   FOOTER
   ============================================================ */
.ks-footer { border-top: 1px solid var(--line); padding: 30px 0; }
.ks-footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ks-logo--sm { font-size: 14px; }
.ks-footer__copy { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; color: var(--muted); }

/* ===========================================================
   REVEAL
   =========================================================== */
.reveal { opacity: 0; transform: translateY(34px); transition: opacity .8s cubic-bezier(.16,1,.3,1), transform .8s cubic-bezier(.16,1,.3,1); }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

html { scroll-behavior: smooth; }
#ks-site [id] { scroll-margin-top: 96px; }

/* ===========================================================
   OVERRIDES — beat Kava parent theme heading rules (specificity)
   ========================================================== */
#ks-site h1, #ks-site h2, #ks-site h3, #ks-site h4 { color: var(--text); }
#ks-site .ks-hero__title,
#ks-site .ks-h2,
#ks-site .ks-card__title,
#ks-site .ks-stat__num,
#ks-site .ks-quote__text,
#ks-site .ks-contact__email { font-family: var(--serif) !important; }
#ks-site .ks-hero__title,
#ks-site .ks-h2,
#ks-site .ks-card__title,
#ks-site .ks-stat__num,
#ks-site .ks-quote__text { color: var(--text); }
#ks-site .ks-contact__email { color: var(--text); }
#ks-site .ks-card__num,
#ks-site .ks-quote__author { color: var(--accent); }
#ks-site .ks-eyebrow,
#ks-site .ks-stat__label,
#ks-site .ks-contact__k { color: var(--muted); }
#ks-site a { box-shadow: none; }
#ks-site .ks-btn { color: #0c120a !important; font-family: var(--mono) !important; }
#ks-site .ks-link { color: var(--text) !important; font-family: var(--mono) !important; }
/* offset fixed header below WP admin bar for logged-in users */
body.admin-bar .ks-header { top: 46px; }
body.admin-bar #ks-site.nav-open .ks-nav { top: 122px; }
@media screen and (min-width: 783px) { body.admin-bar .ks-header { top: 32px; } }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
	.ks-hero__grid { grid-template-columns: 1fr; gap: 40px; }
	.ks-hero__photo { order: -1; }
	.ks-portrait { max-width: 300px; margin: 0 auto; }
	.ks-portrait img { height: 360px; }
	.ks-about__grid { grid-template-columns: 1fr; gap: 28px; }
	.ks-stats__grid { grid-template-columns: repeat(2, 1fr); }
	.ks-stat:nth-child(2) { border-right: 0; }
	.ks-stat:nth-child(1), .ks-stat:nth-child(2) { border-bottom: 1px solid var(--line); }
	.ks-services__grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
	.ks-nav, .ks-header .ks-btn--sm { display: none; }
	.ks-burger { display: inline-flex; flex-direction: column; gap: 5px; margin-left: auto; background: none; border: 0; cursor: pointer; padding: 8px; }
	.ks-burger span { width: 24px; height: 2px; background: var(--text); transition: transform .3s, opacity .3s; }
	#ks-site.nav-open .ks-nav {
		display: flex; flex-direction: column; gap: 0;
		position: fixed; top: 76px; left: 0; right: 0; margin: 0;
		background: rgba(11,15,13,.97); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); z-index: 99;
	}
	#ks-site.nav-open .ks-nav a { padding: 18px var(--pad); border-top: 1px solid var(--line); font-size: 16px; color: var(--text); }
	#ks-site.nav-open .ks-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
	#ks-site.nav-open .ks-burger span:nth-child(2) { opacity: 0; }
	#ks-site.nav-open .ks-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
	.ks-hero { padding-top: 120px; }
	.ks-contact__meta { gap: 32px; }
}
@media (max-width: 460px) {
	.ks-stats__grid { grid-template-columns: 1fr; }
	.ks-stat { border-right: 0 !important; border-bottom: 1px solid var(--line); }
	.ks-stat:last-child { border-bottom: 0; }
}
