/* ==========================================================================
   BCENG — Precision Dark
   ========================================================================== */

:root {
	--bg: #0a0e27;
	--bg-deep: #070a1c;
	--surface: #0f1535;
	--surface-2: #16205a;
	--surface-hi: rgba(30, 60, 114, 0.30);
	--line: rgba(120, 150, 255, 0.16);
	--line-hi: rgba(59, 130, 246, 0.5);
	--text: #e8ecff;
	--text-muted: #9aa5ce;
	--accent: #3b82f6;
	--accent-hi: #60a5fa;
	--cyan: #22d3ee;

	--font-sans: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
	--font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;

	--wrap: 1200px;
	--wrap-narrow: 820px;
	--radius: 10px;
	--radius-sm: 6px;
	--gap: clamp(1rem, 0.6rem + 1.6vw, 2.5rem);
	--section-y: clamp(4rem, 2.5rem + 6vw, 7rem);
	--ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ----- reset / base ----- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
	font-family: var(--font-sans);
	background-color: var(--bg);
	color: var(--text);
	line-height: 1.7;
	font-size: 1rem;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}

img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--cyan); text-decoration: none; transition: color 0.2s var(--ease); }
a:hover { color: var(--accent-hi); }
h1, h2, h3, h4 { line-height: 1.25; font-weight: 700; letter-spacing: -0.01em; }
ul { list-style: none; padding: 0; }

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

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px; overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
	white-space: nowrap; border: 0; padding: 0;
}
.skip-link {
	position: absolute; left: 8px; top: -60px; z-index: 1100;
	background: var(--accent); color: #fff; padding: 10px 16px; border-radius: var(--radius-sm);
	transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 8px; color: #fff; }

/* ----- layout ----- */
.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.wrap-narrow { width: min(100% - 2.5rem, var(--wrap-narrow)); margin-inline: auto; }
.site-main > section,
.site-main > article,
.site-main > .page-body { padding-block: var(--section-y); }
.section-alt { background: linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%); }

/* ----- eyebrow / section head ----- */
.eyebrow {
	font-family: var(--font-mono);
	font-size: 0.78rem;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--cyan);
	margin-bottom: 0.9rem;
}
.eyebrow::before { content: '// '; opacity: 0.6; }
.section-head { max-width: 60ch; margin-bottom: clamp(2rem, 1rem + 3vw, 3.5rem); }
.section-title { font-size: clamp(1.8rem, 1.2rem + 2.4vw, 2.6rem); }
.section-lead { color: var(--text-muted); margin-top: 1rem; font-size: 1.05rem; }

/* ----- buttons ----- */
.btn {
	display: inline-flex; align-items: center; gap: 0.5rem;
	font-weight: 600; font-size: 0.95rem;
	padding: 0.8rem 1.6rem; border-radius: var(--radius-sm);
	border: 1px solid transparent; cursor: pointer;
	transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}
.btn-accent { background: linear-gradient(135deg, var(--accent) 0%, #2563eb 100%); color: #fff; }
.btn-accent:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 12px 28px rgba(59, 130, 246, 0.35); }
.btn-ghost { border-color: var(--line-hi); color: var(--text); }
.btn-ghost:hover { color: #fff; background: var(--surface-hi); }

/* ----- header ----- */
.site-header {
	position: sticky; top: 0; z-index: 1000;
	background: rgba(15, 21, 53, 0.82);
	backdrop-filter: saturate(160%) blur(10px);
	border-bottom: 1px solid var(--line);
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; min-height: 68px; gap: 1.5rem; }
.site-header__left { display: flex; align-items: center; gap: 1.75rem; }
.brand__mark { font-size: 1.4rem; font-weight: 800; letter-spacing: 0.14em; color: #fff; }

.primary-nav__list { display: flex; align-items: center; gap: 1.9rem; }
.primary-nav__list a {
	color: var(--text-muted); font-size: 0.92rem; font-weight: 500;
	font-family: var(--font-mono); letter-spacing: 0.02em;
}
.primary-nav__list a:hover,
.primary-nav__list .current-menu-item > a { color: #fff; }

.nav-toggle {
	display: none; width: 44px; height: 44px; background: none; border: 1px solid var(--line);
	border-radius: var(--radius-sm); position: relative;
}
.nav-toggle__bar,
.nav-toggle__bar::before,
.nav-toggle__bar::after {
	content: ''; position: absolute; left: 50%; width: 20px; height: 2px; background: var(--text);
	transform: translateX(-50%); transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
}
.nav-toggle__bar { top: 50%; margin-top: -1px; }
.nav-toggle__bar::before { top: -6px; }
.nav-toggle__bar::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar::before { transform: translateX(-50%) rotate(45deg); top: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar::after { transform: translateX(-50%) rotate(-45deg); top: 0; }

/* ----- hero ----- */
.hero {
	position: relative;
	overflow: hidden;
	padding-block: clamp(6rem, 3rem + 12vw, 11rem);
	background: radial-gradient(1400px 700px at 70% -20%, #12235c 0%, #0b1130 45%, var(--bg-deep) 100%);
	isolation: isolate;
}
.hero__bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }

/* soft moving aurora blob */
.hero__glow {
	position: absolute; inset: -25% -10% auto -10%; height: 80%;
	background:
		radial-gradient(38% 55% at 25% 40%, rgba(34, 211, 238, 0.30), transparent 70%),
		radial-gradient(45% 60% at 70% 30%, rgba(59, 130, 246, 0.32), transparent 72%),
		radial-gradient(35% 45% at 55% 75%, rgba(129, 74, 236, 0.22), transparent 70%);
	filter: blur(40px);
	animation: hero-drift 22s ease-in-out infinite alternate;
}
@keyframes hero-drift {
	0%   { transform: translate3d(-4%, -2%, 0) scale(1);    opacity: 0.85; }
	50%  { transform: translate3d(3%, 3%, 0) scale(1.12);   opacity: 1; }
	100% { transform: translate3d(6%, -3%, 0) scale(1.05);  opacity: 0.8; }
}

/* perspective grid floor */
.hero__floor {
	position: absolute; left: -20%; right: -20%; bottom: -12%; height: 62%;
	background-image:
		linear-gradient(rgba(90, 130, 255, 0.28) 1px, transparent 1px),
		linear-gradient(90deg, rgba(90, 130, 255, 0.28) 1px, transparent 1px);
	background-size: 46px 46px;
	transform: perspective(560px) rotateX(70deg);
	transform-origin: bottom center;
	mask-image: linear-gradient(to top, #000 0%, rgba(0, 0, 0, 0.35) 45%, transparent 88%);
	animation: hero-floor 7s linear infinite;
}
@keyframes hero-floor { to { background-position: 0 46px, 46px 0; } }

/* node network canvas */
.hero__net {
	position: absolute; inset: 0; width: 100%; height: 100%;
	opacity: 0.85; mix-blend-mode: screen;
	mask-image: radial-gradient(120% 100% at 75% 25%, #000 35%, transparent 82%);
}

/* fine scanline texture */
.hero__scan {
	position: absolute; inset: 0;
	background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.028) 0 1px, transparent 1px 3px);
	mix-blend-mode: overlay; opacity: 0.6;
}

/* legibility scrim behind the copy */
.hero__scrim {
	position: absolute; inset: 0;
	background: linear-gradient(105deg, rgba(7, 10, 28, 0.82) 0%, rgba(7, 10, 28, 0.45) 38%, transparent 70%);
}

.hero .wrap { position: relative; z-index: 1; }
.hero .eyebrow { color: #7fe6f5; text-shadow: 0 0 18px rgba(34, 211, 238, 0.45); }
.hero h1 {
	font-size: clamp(2.1rem, 1.1rem + 4.4vw, 3.9rem);
	max-width: 20ch; margin-bottom: 1.4rem;
	text-shadow: 0 2px 30px rgba(0, 0, 0, 0.45);
}
.hero h1 .accent {
	color: var(--cyan);
	text-shadow: 0 0 30px rgba(34, 211, 238, 0.5);
}
.hero p { color: #ccd5f2; font-size: 1.12rem; max-width: 52ch; margin-bottom: 2rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.9rem; }

@media (prefers-reduced-motion: reduce) {
	.hero__glow, .hero__floor { animation: none; }
}

/* ----- generic card grid ----- */
.grid { display: grid; gap: var(--gap); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--auto { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }

.card {
	background: var(--surface-hi);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 2rem;
	transition: transform 0.25s var(--ease), border-color 0.25s var(--ease), background 0.25s var(--ease);
}
.card:hover { transform: translateY(-4px); border-color: var(--line-hi); background: rgba(30, 60, 114, 0.5); }
.card h3 { color: var(--accent-hi); font-size: 1.15rem; margin-bottom: 0.75rem; }
.card p { color: var(--text-muted); font-size: 0.95rem; }
.card__list li { color: var(--text-muted); font-size: 0.92rem; padding: 0.35rem 0 0.35rem 1.1rem; position: relative; }
.card__list li::before { content: '▸'; position: absolute; left: 0; color: var(--accent); }

/* ----- info stat cards ----- */
.info-card { text-align: center; }
.info-card h3 { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); }
.info-card p { color: #fff; font-size: 1.35rem; font-weight: 700; margin-top: 0.4rem; }

/* ----- project / product cards ----- */
.entry-card { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.entry-card__media { aspect-ratio: 4 / 3; background: linear-gradient(135deg, #1a3a52, #0d2844); overflow: hidden; position: relative; }
.entry-card__media img { width: 100%; height: 100%; object-fit: cover; }
.entry-card__media.is-placeholder::after {
	content: 'IMAGE PENDING'; position: absolute; inset: 0; display: grid; place-items: center;
	font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.18em; color: rgba(255,255,255,0.35);
}
.entry-card__body { padding: 1.5rem; display: flex; flex-direction: column; gap: 0.6rem; flex: 1; }
.entry-card__cat { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--cyan); }
.entry-card__title { font-size: 1.1rem; color: #fff; }
.entry-card__excerpt { color: var(--text-muted); font-size: 0.92rem; }
.entry-card a.stretched::after { content: ''; position: absolute; inset: 0; }
.entry-card { position: relative; }

/* ----- single project / product ----- */
.entry-hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: var(--gap); align-items: start; }
.entry-hero__media { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: linear-gradient(135deg, #1a3a52, #0d2844); aspect-ratio: 4 / 3; }
.entry-hero__media img { width: 100%; height: 100%; object-fit: cover; }
.entry-title { font-size: clamp(1.7rem, 1.1rem + 2.4vw, 2.4rem); margin-bottom: 1rem; }
.spec-box { background: rgba(59, 130, 246, 0.1); border-left: 3px solid var(--accent); padding: 1rem 1.25rem; border-radius: var(--radius-sm); font-size: 0.92rem; color: var(--text-muted); margin-top: 1.25rem; }
.spec-box strong { color: var(--accent-hi); }
.spec-table { width: 100%; border-collapse: collapse; margin-top: 1.25rem; font-size: 0.92rem; }
.spec-table th, .spec-table td { text-align: left; padding: 0.7rem 1rem; border-bottom: 1px solid var(--line); }
.spec-table th { color: var(--text-muted); font-family: var(--font-mono); font-weight: 500; width: 34%; }

/* ----- news ----- */
.post-meta { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-muted); }
.post-meta .sep { opacity: 0.4; margin: 0 0.4rem; }
.prose { max-width: var(--wrap-narrow); }
.prose h2 { margin: 2rem 0 1rem; font-size: 1.5rem; }
.prose h3 { margin: 1.6rem 0 0.8rem; font-size: 1.2rem; }
.prose p, .prose ul, .prose ol { margin-bottom: 1.1rem; color: #cdd4f0; }
.prose ul { list-style: disc; padding-left: 1.4rem; }
.prose ol { list-style: decimal; padding-left: 1.4rem; }
.prose img { border-radius: var(--radius); margin: 1.5rem 0; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }
.prose blockquote { border-left: 3px solid var(--accent); padding-left: 1.25rem; color: var(--text-muted); font-style: italic; }

/* ----- pagination ----- */
.pagination { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 3rem; font-family: var(--font-mono); font-size: 0.9rem; }
.pagination .page-numbers { padding: 0.5rem 0.85rem; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--text-muted); }
.pagination .page-numbers.current { background: var(--accent); border-color: var(--accent); color: #fff; }
.pagination a.page-numbers:hover { color: #fff; border-color: var(--line-hi); }

/* ----- contact form ----- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); align-items: start; }
.form-field { margin-bottom: 1.1rem; }
.form-field label { display: block; font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 0.4rem; }
.form-field input,
.form-field textarea {
	width: 100%; background: var(--bg-deep); border: 1px solid var(--line); border-radius: var(--radius-sm);
	color: var(--text); padding: 0.75rem 0.9rem; font: inherit; font-size: 0.95rem;
	transition: border-color 0.2s var(--ease);
}
.form-field input:focus,
.form-field textarea:focus { border-color: var(--cyan); outline: none; }
.form-field textarea { min-height: 150px; resize: vertical; }
.form-hp { position: absolute !important; left: -9999px !important; }
.form-note { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.75rem; }
.form-message { padding: 0.9rem 1.1rem; border-radius: var(--radius-sm); margin-bottom: 1.25rem; font-size: 0.92rem; }
.form-message.is-ok { background: rgba(34, 211, 238, 0.12); border: 1px solid rgba(34, 211, 238, 0.4); }
.form-message.is-err { background: rgba(248, 113, 113, 0.12); border: 1px solid rgba(248, 113, 113, 0.4); color: #fecaca; }

/* ----- CTA band ----- */
.cta-band { text-align: center; background: linear-gradient(135deg, #16305a 0%, #0d2140 100%); border-block: 1px solid var(--line); }
.cta-band h2 { font-size: clamp(1.6rem, 1rem + 2.4vw, 2.3rem); margin-bottom: 1rem; }
.cta-band p { color: #c3ccec; max-width: 48ch; margin: 0 auto 1.75rem; }

/* ----- reveal on scroll -----
   Content is visible by default. Only when JS is present (html.js) and motion is
   allowed do we hide-then-reveal, so a JS failure never hides content. */
.js [data-reveal] { opacity: 0; transform: translateY(16px); transition: opacity 0.5s var(--ease), transform 0.5s var(--ease); }
.js [data-reveal].is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
	.js [data-reveal] { opacity: 1; transform: none; transition: none; }
}

/* ----- misc ----- */
.muted { color: var(--text-muted); }
.sep { opacity: 0.4; }
.list-inline { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.chip { font-family: var(--font-mono); font-size: 0.78rem; padding: 0.3rem 0.7rem; border: 1px solid var(--line); border-radius: 999px; color: var(--text-muted); }
.chip.is-active,
.chip:hover { color: #fff; border-color: var(--line-hi); }

/* ----- footer ----- */
.site-footer { background: var(--bg-deep); border-top: 1px solid var(--line); padding-block: clamp(3rem, 2rem + 3vw, 4.5rem); }
.site-footer__grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: var(--gap); }
.site-footer h4 { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-hi); margin-bottom: 0.9rem; }
.site-footer p { font-size: 0.9rem; margin-bottom: 0.3rem; }
.site-footer__menu a { color: var(--text-muted); font-size: 0.9rem; display: block; padding: 0.2rem 0; }
.site-footer__bottom { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.site-footer__bottom p { font-size: 0.82rem; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1024px) {
	.grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); }
	.entry-hero { grid-template-columns: 1fr; }
	.contact-grid { grid-template-columns: 1fr; }
	.site-footer__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
	.nav-toggle { display: block; }
	.primary-nav {
		position: fixed; inset: 68px 0 auto 0; background: var(--surface);
		border-bottom: 1px solid var(--line); padding: 1rem 1.25rem 1.5rem;
		transform: translateY(-120%); transition: transform 0.28s var(--ease); visibility: hidden;
	}
	.primary-nav.is-open { transform: translateY(0); visibility: visible; }
	.primary-nav__list { flex-direction: column; align-items: flex-start; gap: 0.25rem; }
	.primary-nav__list a { display: block; padding: 0.75rem 0; font-size: 1rem; width: 100%; }
	.grid--3, .grid--4 { grid-template-columns: 1fr; }
	.site-footer__grid { grid-template-columns: 1fr; }
}
