/* ==========================================================================
   Bali Web Dev — Base
   1. Design tokens
   2. Light theme
   3. Reset & base
   4. Typography
   5. Utilities
   6. Reduced motion
   ========================================================================== */

/* 1. Design tokens ------------------------------------------------------- */
:root {
	/* Latar (charcoal hangat) */
	--bwd-bg: #0d0a0f;
	--bwd-bg-elevated: #151019;
	--bwd-surface: rgba(255, 255, 255, 0.04);
	--bwd-surface-2: rgba(255, 255, 255, 0.07);
	--bwd-border: rgba(255, 255, 255, 0.10);
	--bwd-border-strong: rgba(255, 255, 255, 0.18);

	/* Merek — Bali Sunset */
	--bwd-primary: #ff6b5e;
	--bwd-secondary: #ffb454;
	--bwd-accent: #e0489a;
	--bwd-accent-2: #6d5df6;

	/* Alias historis (agar komponen lama tetap berjalan) */
	--bwd-violet: var(--bwd-primary);
	--bwd-cyan: var(--bwd-secondary);
	--bwd-blue: var(--bwd-accent);
	--bwd-pink: var(--bwd-accent-2);

	/* Teks (hangat) */
	--bwd-text: #f4ede7;
	--bwd-text-muted: #b3a6a0;

	/* Gradient */
	--bwd-gradient: linear-gradient(135deg, #ff6b5e, #ffb454);
	--bwd-gradient-2: linear-gradient(135deg, #e0489a, #ff6b5e);

	--bwd-radius-sm: 10px;
	--bwd-radius: 16px;
	--bwd-radius-lg: 24px;
	--bwd-radius-xl: 32px;
	--bwd-radius-pill: 999px;

	--bwd-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.8);
	--bwd-glow-violet: 0 0 40px rgba(255, 107, 94, 0.35);
	--bwd-glow-cyan: 0 0 40px rgba(255, 180, 84, 0.30);

	--bwd-font-display: "Fraunces", "Playfair Display", Georgia, serif;
	--bwd-font-heading: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
	--bwd-font-body: "Inter", ui-sans-serif, system-ui, sans-serif;
	--bwd-font-mono: "JetBrains Mono", ui-monospace, monospace;

	--bwd-container: 1200px;
	--bwd-header-height: 76px;
	--bwd-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* 2. Light theme --------------------------------------------------------- */
[data-theme="light"] {
	--bwd-bg: #fdf8f4;
	--bwd-bg-elevated: #ffffff;
	--bwd-surface: rgba(60, 30, 20, 0.03);
	--bwd-surface-2: rgba(60, 30, 20, 0.06);
	--bwd-border: rgba(60, 30, 20, 0.10);
	--bwd-border-strong: rgba(60, 30, 20, 0.18);
	--bwd-text: #1a1016;
	--bwd-text-muted: #6b5b57;
	--bwd-shadow: 0 30px 60px -32px rgba(60, 30, 20, 0.25);
}

/* 3. Reset & base -------------------------------------------------------- */
*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
	scroll-padding-top: calc(var(--bwd-header-height) + 16px);
}

body {
	margin: 0;
	font-family: var(--bwd-font-body);
	font-size: 1rem;
	line-height: 1.65;
	background: var(--bwd-bg);
	color: var(--bwd-text);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	overflow-x: hidden;
}

img,
svg,
video {
	max-width: 100%;
	display: block;
}

button {
	font: inherit;
	color: inherit;
	background: none;
	border: 0;
	cursor: pointer;
}

a {
	color: inherit;
	text-decoration: none;
}

ul,
ol {
	margin: 0;
	padding: 0;
	list-style: none;
}

:focus-visible {
	outline: 2px solid var(--bwd-cyan);
	outline-offset: 2px;
	border-radius: 6px;
}

::selection {
	background: var(--bwd-violet);
	color: #fff;
}

::-webkit-scrollbar {
	width: 10px;
}
::-webkit-scrollbar-track {
	background: var(--bwd-bg);
}
::-webkit-scrollbar-thumb {
	background: linear-gradient(var(--bwd-violet), var(--bwd-cyan));
	border-radius: 10px;
}

/* 4. Typography ---------------------------------------------------------- */
h1,
h2,
h3,
h4 {
	font-family: var(--bwd-font-display);
	font-weight: 600;
	line-height: 1.08;
	letter-spacing: -0.01em;
	margin: 0 0 0.5em;
	text-wrap: balance;
}

h1 {
	font-size: clamp(2.4rem, 6vw, 4.4rem);
}
h2 {
	font-size: clamp(1.9rem, 4.5vw, 2.9rem);
}
h3 {
	font-size: clamp(1.2rem, 2.4vw, 1.5rem);
}

p {
	margin: 0 0 1rem;
}

/* 5. Utilities ----------------------------------------------------------- */
.bwd-skip {
	position: absolute;
	left: -999px;
	top: 0;
	z-index: 1000;
	background: var(--bwd-violet);
	color: #fff;
	padding: 0.75rem 1.1rem;
	border-radius: 0 0 10px 0;
}
.bwd-skip:focus {
	left: 0;
}

.bwd-ico {
	width: 1.15em;
	height: 1.15em;
	flex: none;
}

.bwd-gradient-text {
	background: var(--bwd-gradient);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	color: transparent;
}

.bwd-eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 0.55rem;
	margin: 0 0 1rem;
	font-family: var(--bwd-font-mono);
	font-size: 0.78rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--bwd-cyan);
}
.bwd-eyebrow::before {
	content: "";
	width: 26px;
	height: 2px;
	border-radius: 2px;
	background: var(--bwd-gradient);
}

.bwd-lead {
	max-width: 62ch;
	font-size: clamp(1rem, 2.2vw, 1.15rem);
	color: var(--bwd-text-muted);
}

.bwd-muted {
	color: var(--bwd-text-muted);
}

.bwd-screen-reader {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* Reveal (progressive enhancement: terlihat default, disembunyikan bila JS aktif) */
html.js-bwd .js-bwd-reveal {
	opacity: 0;
	transform: translateY(24px);
	transition: opacity 0.7s var(--bwd-ease), transform 0.7s var(--bwd-ease);
}
html.js-bwd .js-bwd-reveal.is-visible {
	opacity: 1;
	transform: none;
}

/* 6. Reduced motion ------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
		scroll-behavior: auto !important;
	}
	html.js-bwd .js-bwd-reveal {
		opacity: 1;
		transform: none;
	}
}
