/**
 * Kate Creatives — dedicated mobile & small-tablet experience
 * Loaded after main + agency for site-wide touch-friendly layout.
 */

/* ========== MOBILE TOKENS ========== */
@media (max-width: 767px) {
	:root {
		--header-height: 72px;
		--section-spacing-mobile: 64px;
		--container-pad: 20px;
		--container-pad-tight: 16px;
		--touch-min: 44px;
		--mobile-lede: 1.65;
	}

	html {
		-webkit-text-size-adjust: 100%;
		text-size-adjust: 100%;
	}

	body {
		overflow-x: clip;
		font-size: 16px;
		line-height: 1.7;
	}

	body.is-menu-open {
		touch-action: none;
	}

	img,
	video,
	svg,
	iframe,
	embed {
		max-width: 100%;
		height: auto;
	}

	.container,
	.container--wide {
		padding-left: var(--container-pad);
		padding-right: var(--container-pad);
	}

	.section,
	.agency-section {
		padding-top: var(--section-spacing-mobile);
		padding-bottom: var(--section-spacing-mobile);
	}

	.page-header--inner {
		padding-top: var(--section-spacing-mobile);
		padding-bottom: 28px;
	}

	/* ========== TYPOGRAPHY ========== */
	h1,
	.agency-hero__title,
	.hero-mar__title {
		font-size: clamp(34px, 9.5vw, 48px) !important;
		line-height: 1.08;
		word-wrap: break-word;
		overflow-wrap: anywhere;
		hyphens: auto;
	}

	h2,
	.agency-title,
	.audit-step h2,
	.kc-merch-section-title {
		font-size: clamp(28px, 7.5vw, 38px);
		line-height: 1.12;
	}

	h3 {
		font-size: clamp(20px, 5.5vw, 26px);
		line-height: 1.2;
	}

	.agency-lede,
	.agency-page-hero__lede,
	p,
	.faq-a,
	.portfolio-card p {
		font-size: 16px;
		line-height: var(--mobile-lede);
		max-width: none;
	}

	.agency-kicker {
		font-size: clamp(22px, 6vw, 28px);
	}

	.agency-eyebrow,
	.mono {
		font-size: 11px;
		letter-spacing: 0.12em;
	}

	/* Prevent split-type overflow on narrow screens (except coverflow intros) */
	.split-word,
	.split-char,
	.kc-text-motion .split-word {
		display: inline;
		white-space: normal !important;
	}

	.split-line {
		overflow: visible;
	}

	.kc-coverflow__intro .agency-kicker {
		font-size: clamp(20px, 5.5vw, 26px);
		margin-bottom: 10px;
		line-height: 1.2;
	}

	.kc-coverflow__intro-row {
		display: flex;
		flex-direction: column;
		gap: 12px;
		align-items: stretch;
	}

	.kc-coverflow__intro .agency-title {
		margin-bottom: 0;
		font-size: clamp(28px, 8vw, 38px) !important;
		line-height: 1.08;
		max-width: 100%;
	}

	/* Keep SplitType structure intact so headings do not double-render */
	.kc-coverflow__intro .split-line {
		display: block;
		overflow: hidden;
	}

	.kc-coverflow__intro .split-word,
	.kc-coverflow__intro .split-char {
		display: inline-block;
		vertical-align: top;
		white-space: normal;
	}

	.kc-coverflow__intro .agency-lede {
		margin: 0;
		max-width: none;
		font-size: 15px;
		line-height: 1.6;
	}

	/* ========== HEADER & NAV ========== */
	.site-header__inner {
		min-height: var(--header-height);
		gap: 12px;
	}

	.site-logo__img {
		height: 36px;
	}

	.site-header__cta,
	.site-header__cta--ghost,
	.site-header__cta--solid {
		padding: 10px 14px;
		font-size: 10px;
		min-height: var(--touch-min);
	}

	.primary-menu > li > a {
		padding: 16px 4px;
		font-size: clamp(20px, 5.2vw, 26px);
		min-height: var(--touch-min);
	}

	.site-header__nav-panel {
		width: min(100%, 100vw);
		max-width: 100%;
		padding-left: var(--container-pad);
		padding-right: var(--container-pad);
		padding-top: max(68px, calc(env(safe-area-inset-top) + 52px));
	}

	.menu-toggle {
		width: var(--touch-min);
		height: var(--touch-min);
		border-radius: 999px;
	}

	.site-header.is-menu-open .menu-toggle {
		position: relative;
		z-index: 4;
	}

	/* ========== BUTTONS & LINKS ========== */
	.btn,
	.btn-agency,
	.kc-merch-btn,
	.audit-nav__btn,
	.agency-work__btn,
	.kc-coverflow__btn {
		min-height: var(--touch-min);
		padding: 14px 22px;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		touch-action: manipulation;
	}

	/* Showreel: keep full-area grid overlay (not inline-flex buttons) */
	.agency-about__play {
		display: grid;
		place-items: center;
		padding: 0;
		min-height: 0;
		width: 100%;
		height: 100%;
		touch-action: manipulation;
	}

	.agency-about__play-ring,
	.agency-about__play-core {
		grid-area: 1 / 1;
	}

	.link-more {
		min-height: var(--touch-min);
		align-items: center;
		padding: 8px 0;
	}

	/* ========== HERO & PAGE BANNERS ========== */
	.agency-hero {
		padding-top: calc(var(--header-height) + 28px);
		padding-bottom: 48px;
	}

	.agency-hero__actions,
	.hero-mar__actions {
		flex-direction: column;
		align-items: stretch;
		gap: 12px;
	}

	.agency-hero__actions .btn,
	.hero-mar__actions .btn {
		width: 100%;
		text-align: center;
	}

	.agency-page-hero {
		padding: calc(var(--header-height) + 24px) 0 40px;
	}

	.agency-page-hero__title {
		font-size: clamp(32px, 9vw, 44px);
	}

	.agency-page-hero__script {
		font-size: clamp(26px, 7vw, 34px);
	}

	.agency-page-hero__crumb ol {
		flex-wrap: wrap;
		gap: 6px 10px;
		font-size: 11px;
	}

	.stripes .page-banner,
	.stripes--thin .page-banner,
	.page-banner {
		padding: calc(var(--header-height) + 20px) var(--container-pad) 36px;
	}

	.page-banner h1 {
		font-size: clamp(30px, 8vw, 40px);
	}

	/* ========== LAYOUT GRIDS ========== */
	.split,
	.contact-grid,
	.hero-mar__grid,
	.agency-about__grid,
	.agency-banner__layout,
	.kc-faq__layout,
	.kc-how-work__compare,
	.kc-team__layout,
	.disc-grid,
	.disc-grid--3,
	.disc-grid--5,
	.tier-grid,
	.portfolio-grid,
	.pricing-packages,
	.pricing-services,
	.team-grid,
	.values-grid,
	.stats-grid,
	.service-cards,
	.test-inner,
	.contact-cards,
	.site-footer__inner {
		grid-template-columns: 1fr !important;
		gap: 28px;
	}

	.agency-about__visual,
	.agency-about__visual--video {
		min-height: min(72vw, 420px);
		border-radius: 16px;
	}

	.agency-about__visual img,
	.agency-about__poster {
		width: 100%;
		object-fit: cover;
	}

	.agency-about__reel-label {
		top: 14px;
		left: 14px;
		font-size: 8px;
		padding: 6px 12px;
	}

	/* ========== SLIDERS & CAROUSELS ========== */
	.kc-coverflow {
		overflow-x: clip;
	}

	.kc-coverflow__intro {
		padding-bottom: 8px;
	}

	.kc-coverflow__stage {
		display: flex;
		flex-direction: column;
		min-height: auto;
		padding-inline: 0;
		padding-bottom: 8px;
	}

	.kc-coverflow .coverflow-slider-wrap {
		flex: 1 1 auto;
		min-height: clamp(220px, 62vw, 320px);
		width: 100%;
	}

	.kc-coverflow .coverflow-slider-active {
		padding: 8px 0 12px;
		overflow: hidden;
	}

	.kc-coverflow .coverflow-slider-item {
		height: clamp(200px, 58vw, 300px);
	}

	.swiper-slide-active .kc-coverflow__caption {
		opacity: 1;
		transform: none;
		padding: 36px 14px 14px;
	}

	.kc-coverflow__caption-title {
		font-size: clamp(15px, 4.2vw, 18px);
	}

	.kc-coverflow__nav {
		position: relative;
		left: auto;
		right: auto;
		bottom: auto;
		order: 2;
		justify-content: center;
		gap: 32px;
		min-height: auto;
		padding: 8px var(--container-pad) 4px;
		pointer-events: auto;
	}

	.kc-coverflow__btn-label {
		display: inline;
		font-size: 10px;
	}

	.swiper-button-prev,
	.swiper-button-next {
		width: var(--touch-min);
		height: var(--touch-min);
	}

	/* ========== STATS & SOCIAL PROOF ========== */
	.agency-stats__grid {
		grid-template-columns: 1fr 1fr;
		gap: 20px 16px;
	}

	.kc-social-proof__logos {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 12px;
	}

	.kc-social-proof__logo {
		padding: 12px 10px;
		min-height: 52px;
	}

	.kc-how-work__stack--connected .kc-how-work__box {
		grid-template-columns: 64px minmax(0, 1fr);
		gap: 10px;
		padding: 12px;
	}

	.kc-how-work__box-copy strong {
		font-size: 15px;
	}

	.kc-how-work__box-copy span {
		font-size: 13px;
		line-height: 1.45;
	}

	/* ========== FORMS (global) ========== */
	.contact-form,
	.audit-form,
	form[class*="form"] {
		width: 100%;
	}

	.form-field {
		margin-bottom: 18px;
	}

	.form-field label {
		font-size: 11px;
		margin-bottom: 6px;
	}

	.form-field input,
	.form-field select,
	.form-field textarea,
	.form-field .kc-select,
	.kc-custom-select__trigger {
		width: 100%;
		min-height: var(--touch-min);
		padding: 12px 14px;
		font-size: 16px;
		border-radius: 8px;
	}

	.form-field textarea {
		min-height: 120px;
		resize: vertical;
	}

	.checkbox-grid {
		grid-template-columns: 1fr;
		gap: 10px;
	}

	.checkbox-item {
		min-height: var(--touch-min);
		padding: 12px 14px;
		font-size: 15px;
		align-items: center;
	}

	.checkbox-item input[type="checkbox"] {
		width: 22px;
		height: 22px;
		min-width: 22px;
	}

	.kc-custom-select__menu {
		left: 0;
		right: 0;
		max-height: min(200px, calc(50dvh - env(safe-area-inset-bottom)));
	}

	.kc-custom-select__option {
		padding: 12px 14px;
		font-size: 15px;
		min-height: var(--touch-min);
		display: flex;
		align-items: center;
	}

	.kc-form-message {
		padding: 22px 18px;
		text-align: left;
	}

	.kc-form-message__lede,
	.kc-form-message__steps {
		max-width: none;
		margin-left: 0;
	}

	/* ========== AI AUDIT WIZARD ========== */
	.audit-wizard {
		padding: 20px var(--container-pad-tight);
		margin-left: calc(-1 * var(--container-pad-tight));
		margin-right: calc(-1 * var(--container-pad-tight));
		width: calc(100% + 2 * var(--container-pad-tight));
		max-width: none;
		border-radius: 0;
		border-left: 0;
		border-right: 0;
		box-shadow: none;
	}

	.audit-progress {
		top: calc(var(--header-height) - 1px);
		margin-left: calc(-1 * var(--container-pad-tight));
		margin-right: calc(-1 * var(--container-pad-tight));
		padding: 12px var(--container-pad-tight);
		overflow-x: auto;
		overflow-y: hidden;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
		gap: 0;
		justify-content: flex-start;
		flex-wrap: nowrap;
	}

	.audit-progress::-webkit-scrollbar {
		display: none;
	}

	.audit-progress-step {
		flex: 0 0 auto;
		min-width: max-content;
		padding: 6px 10px;
		font-size: 9px;
		white-space: nowrap;
	}

	.audit-step h2 {
		font-size: clamp(22px, 6vw, 28px);
		margin-bottom: 20px;
	}

	.audit-nav {
		flex-direction: column-reverse;
		align-items: stretch;
		gap: 10px;
		margin-top: 24px;
	}

	.audit-nav__btn {
		width: 100%;
	}

	.audit-success,
	.audit-form__error {
		font-size: 15px;
	}

	.audit-steps-list ol {
		padding-left: 1.2em;
	}

	/* ========== CARDS & CONTENT ========== */
	.portfolio-card,
	.service-card-item,
	.agency-service-card,
	.pricing-card,
	.team-card,
	.kc-case-card,
	.kc-merch-card {
		padding: 20px 18px;
	}

	.portfolio-filters {
		flex-wrap: wrap;
		gap: 8px;
		justify-content: flex-start;
	}

	.portfolio-filters button {
		min-height: var(--touch-min);
		padding: 10px 14px;
		font-size: 11px;
	}

	.faq-item {
		padding: 20px 0;
	}

	.faq-q {
		font-size: 16px;
		line-height: 1.35;
	}

	/* ========== FOOTER & CTA ========== */
	.site-footer__collaborate-inner {
		text-align: left;
		padding: 40px var(--container-pad);
	}

	.agency-banner__layout {
		text-align: left;
	}

	.agency-banner__actions {
		flex-direction: column;
		align-items: stretch;
	}

	.agency-banner__actions .btn-agency {
		width: 100%;
	}

	.site-footer__inner {
		gap: 32px;
	}

	.help-widget {
		padding: 6px;
		gap: 0;
	}

	.help-widget__copy {
		display: none;
	}

	.help-widget__icon {
		width: 48px;
		height: 48px;
	}

	.help-widget__icon svg {
		width: 24px;
		height: 24px;
	}

	/* ========== LIGHTBOX / VIDEO ========== */
	.kc-lightbox__dialog {
		width: min(100vw - 24px, calc((100dvh - 48px) * 9 / 16));
		max-height: calc(100dvh - 24px);
		border-radius: 16px;
	}

	.kc-lightbox__close {
		top: max(10px, env(safe-area-inset-top));
		right: 10px;
		width: var(--touch-min);
		height: var(--touch-min);
	}

	.kc-player__bar {
		padding: 10px 12px;
		gap: 8px;
		flex-wrap: wrap;
	}

	.kc-player__btn {
		min-width: var(--touch-min);
		min-height: var(--touch-min);
	}

	/* ========== MERCH (when mobile.css loads globally) ========== */
	.kc-merch-hero__grid {
		grid-template-columns: 1fr;
		gap: 24px;
	}

	.kc-merch-slider {
		padding: 0 var(--container-pad);
	}

	.kc-merch-filters {
		overflow-x: auto;
		flex-wrap: nowrap;
		-webkit-overflow-scrolling: touch;
		padding-bottom: 4px;
		scrollbar-width: none;
	}

	.kc-merch-filters::-webkit-scrollbar {
		display: none;
	}

	.kc-merch-filters__btn {
		flex-shrink: 0;
		min-height: var(--touch-min);
	}
}

/* ========== SMALL PHONES ========== */
@media (max-width: 479px) {
	:root {
		--container-pad: 16px;
		--section-spacing-mobile: 56px;
	}

	.agency-stats__grid {
		grid-template-columns: 1fr;
	}

	.kc-social-proof__logos {
		grid-template-columns: 1fr 1fr;
	}

	.audit-progress-step:not(.is-active):not(.is-complete) {
		opacity: 0.45;
	}

	.cta-band__inner {
		padding: 40px 20px 48px;
	}

	.site-header__actions .site-header__cta--ghost {
		display: none;
	}

	.kc-how-work__stack--connected .kc-how-work__box {
		grid-template-columns: 56px minmax(0, 1fr);
	}

	.kc-how-work__stack--connected .kc-how-work__box:not(:last-child)::after {
		left: 41px;
	}
}

/* ========== LANDSCAPE PHONES ========== */
@media (max-width: 767px) and (orientation: landscape) {
	.agency-hero,
	.agency-page-hero {
		padding-top: calc(var(--header-height) + 16px);
		padding-bottom: 32px;
	}

	.kc-lightbox__frame {
		max-height: calc(100dvh - 16px);
	}
}
