/* ============ Tokens & themes ============ */
:root {
	--bg: #ffffff;
	--bg-elevated: #ffffff;
	--bg-soft: #f7f7f8;
	--ink: #1a1a1a;
	--ink-soft: #565656;
	--ink-mute: #8b8b8b;
	--ink-hint: #c2c2c2;
	--line: #ececec;
	--line-strong: #d6d6d6;
	--blue: #1769ff;
	--blue-bright: #36f;
	--shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);

	/* brand surfaces */
	--datlite-bg: #ff8364;
	--datlite-title: #ffe0d8;
	--imade-bg: #5bb096;
	--bloody-bg: #ff6565;

	--contact-title: #ececec;

	/* layout */
	--container: 900px;
	--pad-x: clamp(20px, 4vw, 56px);
	--nav-h: 64px;

	--t-fast: 180ms;
	--t-med: 340ms;
	--ease: cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
	--bg: #0e0e10;
	--bg-elevated: #161618;
	--bg-soft: #1a1a1d;
	--ink: #f1f1f3;
	--ink-soft: #b8b8bd;
	--ink-mute: #8a8a90;
	--ink-hint: #4a4a52;
	--line: #2a2a2f;
	--line-strong: #3a3a40;
	--blue: #1769ff;
	--blue-bright: #1769ff;
	--shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.45);
	--contact-title: #1f1f23;
}

* {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
	font-size: 16px;
	scroll-padding-top: var(--nav-h);
}

body {
	margin: 0;
	font-family: "DM Sans", system-ui, -apple-system, sans-serif;
	font-variation-settings: "opsz" 14;
	font-size: 1rem;
	line-height: 1.5;
	color: var(--ink);
	background: var(--bg);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	transition: background var(--t-med) var(--ease),
		color var(--t-med) var(--ease);
}

img {
	max-width: 100%;
	display: block;
}
a {
	color: inherit;
	text-decoration: none;
}
button {
	font: inherit;
	background: none;
	border: 0;
	padding: 0;
	cursor: pointer;
	color: inherit;
}

/* ============ Navbar (no border, no active underline) ============ */
.navbar {
	position: sticky;
	top: 0;
	z-index: 50;
	background: color-mix(in srgb, var(--bg) 85%, transparent);
	backdrop-filter: saturate(180%) blur(14px);
	-webkit-backdrop-filter: saturate(180%) blur(14px);
	transition: background var(--t-med) var(--ease);
}
.navbar__inner {
	max-width: var(--container);
	margin: 0 auto;
	padding: 14px var(--pad-x);
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	gap: 16px;
}

/* Transparent wrapper on desktop — children behave as direct nav flex items */
.navbar__nav-items {
	display: contents;
}

/* K logo */
.navbar__brand {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 32px;
	transition: transform var(--t-fast) var(--ease);
}
.navbar__brand:hover {
	transform: rotate(-6deg) scale(1.06);
}
.navbar__logo {
	height: 28px;
	width: auto;
	display: block;
	transition: filter var(--t-med) var(--ease);
}
[data-theme="dark"] .navbar__logo {
	filter: invert(1);
}

/* Right slot: theme toggle + hamburger */
.navbar__right {
	display: flex;
	align-items: center;
	gap: 14px;
}

/* Hamburger — hidden on desktop, same visual weight as theme toggle */
.nav-toggle {
	display: none;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	gap: 4px;
	width: 20px;
	height: 20px;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
	opacity: 0.8;
	transition: transform var(--t-fast) var(--ease),
		opacity var(--t-fast) var(--ease);
}
.nav-toggle:hover {
	transform: scale(1.12);
	opacity: 1;
}
.nav-toggle__bar {
	display: block;
	width: 14px;
	height: 1.5px;
	border-radius: 2px;
	background: var(--ink);
	transform-origin: center;
	transition: transform var(--t-fast) var(--ease),
		opacity var(--t-fast) var(--ease);
}
/* Animate to X when open */
.navbar.is-open .nav-toggle__bar:nth-child(1) {
	transform: translateY(5.5px) rotate(45deg);
}
.navbar.is-open .nav-toggle__bar:nth-child(2) {
	opacity: 0;
	transform: scaleX(0);
}
.navbar.is-open .nav-toggle__bar:nth-child(3) {
	transform: translateY(-5.5px) rotate(-45deg);
}

/* Center-aligned links, no underline anywhere */
.navbar__nav {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: clamp(14px, 2.6vw, 36px);
}
.navlink {
	font-family: "DM Sans", sans-serif;
	font-weight: 500;
	font-size: 14px;
	letter-spacing: -0.01em;
	color: var(--ink-mute);
	padding: 8px 4px;
	transition: color var(--t-fast) var(--ease);
}
.navlink:hover {
	color: var(--ink);
}
.navlink.is-active {
	color: var(--ink);
}

/* ---- Theme toggle (sun ↔ crescent moon morph) ---- */
.theme-toggle {
	position: relative;
	width: 20px;
	height: 20px;
	display: inline-grid;
	place-items: center;
	border-radius: 999px;
	border: 0;
	background: transparent;
	transition: transform var(--t-fast) var(--ease),
		opacity var(--t-fast) var(--ease);
	opacity: 0.8;
}
.theme-toggle:hover {
	transform: scale(1.12);
	opacity: 1;
}

/* The orb: hollow circle (sun core) → filled crescent in dark */
.theme-toggle__orb {
	position: relative;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	border: 1.4px solid var(--ink);
	background: transparent;
	overflow: hidden;
	transition: width var(--t-med) var(--ease), height var(--t-med) var(--ease),
		border-color var(--t-med) var(--ease), background var(--t-med) var(--ease),
		transform var(--t-med) var(--ease);
}
.theme-toggle__cutout {
	position: absolute;
	top: -60%;
	right: -60%;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	background: var(--bg);
	transform: scale(0);
	transform-origin: center;
	transition: transform var(--t-med) var(--ease),
		background var(--t-med) var(--ease), top var(--t-med) var(--ease),
		right var(--t-med) var(--ease);
}

/* 8 sun rays around the orb */
.theme-toggle__rays {
	position: absolute;
	inset: 0;
	pointer-events: none;
	transition: opacity var(--t-fast) var(--ease),
		transform var(--t-med) var(--ease);
}
.theme-toggle__rays span {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 1.2px;
	height: 2px;
	margin-left: -0.6px;
	margin-top: -1px;
	background: var(--ink);
	border-radius: 1px;
	transform-origin: 50% 50%;
}
.theme-toggle__rays span:nth-child(1) {
	transform: rotate(0deg) translateY(-7.5px);
}
.theme-toggle__rays span:nth-child(2) {
	transform: rotate(45deg) translateY(-7.5px);
}
.theme-toggle__rays span:nth-child(3) {
	transform: rotate(90deg) translateY(-7.5px);
}
.theme-toggle__rays span:nth-child(4) {
	transform: rotate(135deg) translateY(-7.5px);
}
.theme-toggle__rays span:nth-child(5) {
	transform: rotate(180deg) translateY(-7.5px);
}
.theme-toggle__rays span:nth-child(6) {
	transform: rotate(225deg) translateY(-7.5px);
}
.theme-toggle__rays span:nth-child(7) {
	transform: rotate(270deg) translateY(-7.5px);
}
.theme-toggle__rays span:nth-child(8) {
	transform: rotate(315deg) translateY(-7.5px);
}

/* Dark state: hollow sun morphs into a crescent moon via box-shadow trick */
[data-theme="dark"] .theme-toggle__orb {
	width: 11px;
	height: 11px;
	background: transparent;
	border-color: transparent;
	box-shadow: -3px 3px 0 2px var(--ink);
	transform: rotate(-20deg);
}
[data-theme="dark"] .theme-toggle__cutout {
	transform: scale(0);
}
[data-theme="dark"] .theme-toggle__rays {
	opacity: 0;
	transform: rotate(80deg) scale(0.4);
}

/* ============ Content shell ============ */
.content {
	max-width: var(--container);
	margin: 0 auto;
	padding: 0 var(--pad-x);
}
section {
	scroll-margin-top: calc(var(--nav-h) + 12px);
}

/* ============ About ============ */
.about {
	padding-top: clamp(72px, 2vw, 128px);
	padding-bottom: clamp(72px, 4vw, 128px);
}
.about__photo {
	width: 150px;
	height: 150px;
	border-radius: 18px;
	overflow: hidden;
	margin-bottom: 28px;
	background: transparent;
}
.about__photo img {
	width: 100%;
	height: 100%;
	margin: -8% 0 0 -8%;
	object-fit: cover;
}
.about__hello {
	font-family: "DM Sans", sans-serif;
	font-weight: 500;
	font-size: clamp(36px, 5vw, 48px);
	line-height: 1.15;
	letter-spacing: -0.01em;
	margin: 0 0 40px;
}
.about__hello--light {
	display: block;
	color: var(--ink-hint);
	margin-bottom: 4px;
}
.about__hello--dark {
	display: block;
	color: var(--ink);
}
.about__bio {
	font-size: 1.125rem;
	line-height: 1.65;
	color: var(--ink-soft);
	margin: 0 0 18px;
	max-width: 760px;
}
.about__bio:last-of-type {
	margin-bottom: 0;
}
.about__actions {
	display: flex;
	gap: 16px;
	align-items: center;
	margin-top: 4rem;
	flex-wrap: wrap;
}
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 44px;
	border-radius: 10px;
	font-family: "Epilogue", sans-serif;
	font-weight: 500;
	font-size: 14px;
	padding: 0 28px;
	min-width: 180px;
	transition: transform var(--t-fast) var(--ease),
		filter var(--t-fast) var(--ease);
}
.btn--primary {
	background: var(--blue);
	color: #fff;
}
.btn--primary:hover {
	transform: translateY(-1px);
}
.iconbtn {
	width: 44px;
	height: 44px;
	border: 1px solid var(--line);
	border-radius: 10px;
	display: grid;
	place-items: center;
	background: var(--bg-elevated);
	transition: border-color var(--t-fast) var(--ease),
		transform var(--t-fast) var(--ease);
}
.iconbtn:hover {
	border-color: var(--line-strong);
	transform: translateY(-1px);
}
.iconbtn img {
	width: 20px;
	height: 20px;
}
[data-theme="dark"] .iconbtn img {
	filter: brightness(0) invert(1);
}

/* ============ Work ============ */
.work {
	padding-top: clamp(40px, 6vw, 80px);
	padding-bottom: clamp(40px, 6vw, 80px);
}
.work__grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	column-gap: 24px;
	align-items: start;
}
.work__col {
	display: flex;
	flex-direction: column;
	gap: 28px;
}
.card {
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.card__link {
	display: flex;
	flex-direction: column;
	gap: 12px;
	text-decoration: none;
	color: inherit;
}
.card__link:hover .card__title {
	text-decoration: underline;
	text-underline-offset: 3px;
}
.card__title {
	font-family: "DM Sans", sans-serif;
	font-weight: 500;
	font-size: 15px;
	color: var(--ink);
	margin: 0;
	line-height: 1.35;
}
.thumb {
	width: 100%;
	border-radius: 14px;
	overflow: hidden;
	background: var(--bg-soft);
	position: relative;
	transition: transform var(--t-med) var(--ease),
		box-shadow var(--t-med) var(--ease);
}
.thumb:hover {
	transform: translateY(-3px);
	box-shadow: var(--shadow);
}
.thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.thumb--ratio-paymate {
	aspect-ratio: 318 / 311;
}
.thumb--ratio-grandma {
	aspect-ratio: 318 / 194;
}
.thumb--ratio-ar {
	aspect-ratio: 318 / 390;
}
.thumb--ratio-traffic {
	aspect-ratio: 318 / 322;
}
.thumb--ratio-getaway {
	aspect-ratio: 318 / 277;
}
.thumb--ratio-cart {
	aspect-ratio: 318 / 205;
}

.thumb--datlite {
	aspect-ratio: 318 / 282;
	background: var(--datlite-bg);
	overflow: hidden;
}
.datlite__title {
	position: absolute;
	left: 22px;
	top: 20px;
	color: var(--datlite-title);
	font-family: "KoHo", sans-serif;
	font-weight: 700;
	font-size: 44px;
	letter-spacing: 1px;
	line-height: 1;
}
.datlite__laptop {
	position: absolute;
	left: 50%;
	bottom: -8%;
	transform: translateX(-50%);
	width: 92%;
	max-width: none;
}

.thumb--imade {
	aspect-ratio: 318 / 180;
	background: var(--imade-bg);
	display: grid;
	place-items: center;
	text-align: center;
	line-height: 1;
}
.imade__line1 {
	display: block;
	font-family: "El Messiri", serif;
	font-weight: 400;
	color: rgba(255, 255, 255, 0.7);
	font-size: 16px;
	margin-bottom: 4px;
}
.imade__line2 {
	display: block;
	font-family: "Fascinate Inline", display;
	color: rgba(255, 255, 255, 0.95);
	font-size: 32px;
	letter-spacing: 0.5px;
}

.thumb--bloody {
	aspect-ratio: 318 / 323;
	background: var(--bloody-bg);
}
.bloody__hash {
	position: absolute;
	left: 12%;
	top: 16%;
	width: 76%;
	height: auto;
	pointer-events: none;
}
.bloody__top,
.bloody__bottom {
	position: absolute;
	font-family: "Kranky", cursive;
	color: #fff;
	letter-spacing: -0.05em;
	line-height: 1;
}
.bloody__top {
	top: 13%;
	left: 17%;
	font-size: 20px;
	transform: skewX(-10deg);
}
.bloody__bottom {
	bottom: 22%;
	right: 11%;
	font-size: 28px;
	transform: skewX(-12deg);
}
.bloody__big {
	position: absolute;
	top: 36%;
	left: 50%;
	transform: translateX(-50%);
	font-family: "Kirang Haerang", cursive;
	color: #fff;
	font-size: 64px;
	white-space: nowrap;
	line-height: 1;
}
.bloody__drop {
	position: absolute;
	top: 47%;
	left: 51%;
	width: 24px;
	height: 24px;
	transform: translateX(-50%);
}

/* ============ References ============ */
.refs {
	padding-top: clamp(40px, 6vw, 80px);
	padding-bottom: clamp(40px, 6vw, 80px);
}
.refs__grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	column-gap: clamp(32px, 6vw, 100px);
	row-gap: 56px;
}
.ref {
	margin: 0;
	display: flex;
	flex-direction: column;
}
.ref blockquote {
	margin: 0 0 14px;
	font-family: "DM Sans", sans-serif;
	font-weight: 400;
	font-size: 1rem;
	line-height: 1.55;
	color: var(--ink);
}
.ref figcaption {
	display: flex;
	gap: 18px;
	font-size: 14px;
	align-items: center;
	flex-wrap: wrap;
	margin-top: auto;
}
.ref__name {
	color: var(--blue);
	text-decoration: underline;
}
.ref__role {
	color: var(--ink-mute);
}

/* ============ Contact ============ */
.contact {
	text-align: center;
	padding-top: clamp(60px, 8vw, 100px);
	padding-bottom: clamp(40px, 6vw, 60px);
}
.contact__title {
	font-family: "DM Sans", sans-serif;
	font-weight: 500;
	font-size: clamp(48px, 9vw, 96px);
	line-height: 1.05;
	letter-spacing: -0.02em;
	color: var(--contact-title);
	margin: 0 0 24px;
}
.contact__copy {
	max-width: 640px;
	margin: 0 auto 28px;
	font-size: 1rem;
	color: var(--ink);
	line-height: 1.55;
}
.contact__cta {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	background: var(--blue-bright);
	color: #fff;
	font-weight: 500;
	font-size: 15px;
	padding: 16px 36px;
	border-radius: 999px;
	letter-spacing: -0.01em;
	transition: transform var(--t-fast) var(--ease),
		filter var(--t-fast) var(--ease);
}
.contact__cta:hover {
	transform: translateY(-2px);
	filter: brightness(1.05);
}
.contact__cta img {
	width: 12px;
	height: 12px;
}
[data-theme="dark"] .contact__cta img {
	filter: brightness(2);
}

/* ============ Footer ============ */
.footer {
	margin-top: 60px;
	padding: 32px 0 28px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 13px;
	letter-spacing: -0.01em;
	flex-wrap: wrap;
	gap: 16px;
	border-top: 1px solid var(--line);
	color: var(--ink-soft);
}
.footer ul {
	display: flex;
	gap: 28px;
	list-style: none;
	padding: 0;
	margin: 0;
}
.footer a {
	color: var(--ink);
}
.footer a:hover {
	color: var(--blue);
}

/* ============ Responsive ============ */
@media (max-width: 980px) {
	.values__stage {
		max-width: 760px;
		height: 520px;
	}
	.varrow--1 {
		right: 180px;
		width: 60px;
	}
	.varrow--2 {
		right: 175px;
	}
	.varrow--3 {
		left: 175px;
	}
	.varrow--4 {
		left: calc(50% - 110px);
	}
}

@media (max-width: 900px) {
	.about__hello {
		font-size: 38px;
	}
	.work__grid {
		grid-template-columns: repeat(2, 1fr);
	}
	.values__stage {
		height: 480px;
		max-width: 620px;
	}
	.values__list {
		font-size: 40px;
	}
	.varrow--1 {
		right: 130px;
		width: 48px;
	}
	.varrow--2 {
		right: 130px;
		width: 28px;
	}
	.varrow--3 {
		left: 130px;
		width: 40px;
	}
	.varrow--4 {
		left: calc(50% - 90px);
		width: 42px;
	}
	.vhint {
		max-width: 140px;
	}
}

@media (max-width: 720px) {
	:root {
		--pad-x: 18px;
	}
	/* Show hamburger */
	.nav-toggle {
		display: flex;
	}

	/* Top bar: brand left, right slot right */
	.navbar__inner {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		justify-content: space-between;
		gap: 0;
		padding: 10px var(--pad-x);
	}

	/* Drawer: grid-row trick — animates to exact content height */
	.navbar__nav {
		/* Reset desktop flex properties */
		justify-content: initial;
		align-items: initial;
		gap: 0;
		/* Flex item in .navbar__inner: full width, second row */
		flex: 0 0 100%;
		order: 10;
		/* Grid container for the row animation */
		display: grid;
		grid-template-rows: 0fr;
		grid-template-columns: 1fr;
		overflow: hidden; /* clips content when row is 0fr */
		border-top: 1px solid transparent;
		transition: grid-template-rows var(--t-med) var(--ease);
	}
	.navbar__nav-items {
		/* Grid item — must have both of these for 0fr to collapse fully */
		min-height: 0;
		overflow: hidden;
		display: flex;
		flex-direction: column;
		padding: 0;
		transition: padding var(--t-med) var(--ease);
	}
	.navbar.is-open .navbar__nav {
		grid-template-rows: 1fr;
	}
	.navbar.is-open .navbar__nav-items {
		padding: 6px 0 10px;
	}
	.navlink {
		font-size: 15px;
		padding: 11px var(--pad-x);
	}
	.about__hello {
		font-size: 32px;
	}
	.about__bio {
		font-size: 16px;
	}
	.btn {
		width: 100%;
		min-width: 0;
	}

	.values__stage {
		height: auto;
		max-width: 100%;
	}
	.values__list {
		position: static;
		transform: none;
		width: 100%;
		font-size: 32px;
	}
	.vhint,
	.varrow {
		display: none;
	}
	.values__caption {
		text-align: left;
		max-width: 100%;
		margin: 24px auto 0;
	}

	.work__grid {
		grid-template-columns: 1fr;
	}
	.refs__grid {
		grid-template-columns: 1fr;
		row-gap: 36px;
	}
	.contact__title {
		font-size: 44px;
	}
	.contact__copy {
		font-size: 15px;
	}
	.contact__cta {
		font-size: 14px;
		padding: 14px 28px;
	}

	.footer {
		flex-direction: column;
		text-align: center;
	}
	.footer ul {
		gap: 18px;
		flex-wrap: wrap;
		justify-content: center;
	}
	.datlite__title {
		font-size: 36px;
	}
	.bloody__big {
		font-size: 48px;
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		transition-duration: 0ms !important;
		animation-duration: 0ms !important;
	}
}
