/* Newbeings 1619 Signal — front end */
@font-face {
	font-family: "NBS Oxanium";
	src: url("../fonts/oxanium-latin.woff2") format("woff2");
	font-weight: 200 800;
	font-display: swap;
}

.nbs-root {
	--nbs-bg: #172858;
	--nbs-panel: #21366F;
	--nbs-panel-2: #2C469B;
	--nbs-line: rgba(218, 190, 153, 0.3);
	--nbs-copper: #DABE99;
	--nbs-amber: #DABE99;
	--nbs-cream: #FAF8F4;
	--nbs-mute: #D9E1F5;
	--nbs-paper: #FAF8F4;
	--nbs-card: #FFFFFF;
	--nbs-ink: #191919;
	--nbs-ink2: #48506A;
	--nbs-edge: rgba(44, 70, 155, 0.3);
	--nbs-accent: #2C469B;
	--nbs-display: "NBS Oxanium", "Segoe UI", system-ui, sans-serif;
	--nbs-text: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--c: var(--nbs-amber);
	position: relative;
	box-sizing: border-box;
	background: var(--nbs-paper);
	color: var(--nbs-ink);
	font-family: var(--nbs-text);
	font-size: 16px;
	line-height: 1.5;
	border-radius: 20px;
	padding: 0 0 28px;
	overflow: hidden;
	text-align: left;
}
.nbs-root *, .nbs-root *::before, .nbs-root *::after { box-sizing: border-box; }
.nbs-root.nbs-root :where(h2, h3, p) { margin: 0; padding: 0; color: inherit; }
.nbs-root.nbs-root :where(button, input) { font: inherit; margin: 0; }
.nbs-root :focus-visible { outline: 2px solid var(--nbs-accent); outline-offset: 3px; }

/* ---- Stage (3D field) ---- */
.nbs-stage {
	position: relative;
	overflow: hidden;
	background:
		radial-gradient(120% 90% at 50% 115%, rgba(218, 190, 153, 0.34), transparent 60%),
		var(--nbs-bg);
	border-bottom: 1px solid var(--nbs-line);
	color: var(--nbs-cream);
}
.nbs-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 1.2s ease; }
.nbs-live3d .nbs-canvas { opacity: 1; }
.nbs-static {
	background:
		radial-gradient(2px 2px at 12% 30%, #DABE99 50%, transparent 51%),
		radial-gradient(2px 2px at 28% 62%, #FAF8F4 50%, transparent 51%),
		radial-gradient(3px 3px at 44% 24%, #DABE99 50%, transparent 51%),
		radial-gradient(2px 2px at 61% 48%, #DABE99 50%, transparent 51%),
		radial-gradient(3px 3px at 74% 20%, #FAF8F4 50%, transparent 51%),
		radial-gradient(2px 2px at 88% 58%, #FAF8F4 50%, transparent 51%),
		radial-gradient(120% 90% at 50% 115%, rgba(218, 190, 153, 0.4), transparent 60%),
		var(--nbs-bg);
	height: 220px !important;
}
.nbs-labels { position: absolute; inset: 0; pointer-events: none; }
.nbs-label {
	position: absolute; left: 0; top: 0;
	font-family: var(--nbs-display); font-size: 0.82rem; font-weight: 500; letter-spacing: 0.04em;
	color: var(--c); white-space: nowrap;
	padding: 3px 10px; border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); border-radius: 999px;
	background: rgba(23, 40, 88, 0.55);
	opacity: 0; transition: opacity 0.8s ease 1.2s;
}
.nbs-live3d .nbs-label { opacity: 1; }
.nbs-stage .nbs-head { position: absolute; left: clamp(18px, 4vw, 44px); bottom: clamp(16px, 3vw, 30px); pointer-events: none; }
.nbs-head { padding: 30px clamp(18px, 4vw, 44px) 26px; color: var(--nbs-cream); background: radial-gradient(120% 160% at 50% 160%, rgba(218, 190, 153, 0.34), transparent 60%), var(--nbs-bg); }
.nbs-stage .nbs-head { padding: 0; background: none; }
.nbs-root.nbs-root .nbs-heading {
	font-family: var(--nbs-display);
	font-weight: 600;
	font-size: clamp(2.4rem, 6vw, 4.6rem);
	line-height: 0.95;
	letter-spacing: -0.02em;
	color: var(--nbs-cream);
	text-shadow: 0 0 34px rgba(218, 190, 153, 0.35);
}
.nbs-livenote { margin-top: 8px !important; color: var(--nbs-mute); font-size: 0.92rem; }
.nbs-livenote:not(:empty)::before {
	content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%;
	background: var(--nbs-amber); margin-right: 9px; box-shadow: 0 0 0 0 rgba(218, 190, 153, 0.7);
	animation: nbs-ping 2.4s ease-out infinite;
}
@keyframes nbs-ping { 70% { box-shadow: 0 0 0 9px rgba(218, 190, 153, 0); } 100% { box-shadow: 0 0 0 0 rgba(218, 190, 153, 0); } }
.nbs-hint { position: absolute; right: clamp(18px, 4vw, 44px); bottom: clamp(16px, 3vw, 30px); max-width: 15rem; text-align: right; color: var(--nbs-mute); font-size: 0.82rem; display: none; pointer-events: none; }
.nbs-live3d .nbs-hint { display: block; }
.nbs-tip {
	position: absolute; left: 0; top: 0; width: 280px; pointer-events: none;
	padding: 12px 14px; border-radius: 12px;
	background: rgba(33, 54, 111, 0.82); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
	border: 1px solid var(--nbs-line);
	opacity: 0; transition: opacity 0.15s ease;
	display: grid; gap: 4px; font-size: 0.9rem; line-height: 1.35;
}
.nbs-tip.is-on { opacity: 1; }
.nbs-tip strong { font-weight: 600; color: var(--nbs-cream); }
.nbs-tip-src { color: var(--c); font-size: 0.8rem; }
.nbs-tip-time { color: var(--nbs-mute); font-size: 0.8rem; }

/* ---- Controls ---- */
.nbs-bar { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; justify-content: space-between; padding: 20px clamp(18px, 4vw, 44px) 0; }
.nbs-chips, .nbs-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.nbs-root.nbs-root .nbs-chip, .nbs-root.nbs-root .nbs-sort, .nbs-root.nbs-root .nbs-more, .nbs-root.nbs-root .nbs-retry, .nbs-root.nbs-root .nbs-listen {
	appearance: none; cursor: pointer; color: var(--nbs-ink);
	background: transparent; border: 1px solid var(--nbs-edge); border-radius: 999px;
	padding: 7px 15px; font-size: 0.9rem; line-height: 1.2;
	transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.nbs-chip::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); margin-right: 8px; box-shadow: 0 0 0 1px rgba(25, 25, 25, 0.5); }
.nbs-root.nbs-root .nbs-chip[aria-pressed="true"] { background: var(--nbs-ink); border-color: var(--nbs-ink); color: var(--nbs-paper); }
.nbs-root.nbs-root .nbs-chip:hover, .nbs-root.nbs-root .nbs-sort:hover, .nbs-root.nbs-root .nbs-more:hover, .nbs-root.nbs-root .nbs-listen:hover { border-color: var(--nbs-accent); color: var(--nbs-accent); }
.nbs-root.nbs-root .nbs-sort[aria-pressed="true"], .nbs-root.nbs-root .nbs-chip[aria-pressed="true"]:hover { background: var(--nbs-ink); border-color: var(--nbs-ink); color: var(--nbs-paper); }
.nbs-root.nbs-root .nbs-search {
	appearance: none; width: 13rem; max-width: 100%; color: var(--nbs-ink);
	background: rgba(255, 255, 255, 0.35); border: 1px solid var(--nbs-edge); border-radius: 999px;
	padding: 7px 15px; font-size: 0.9rem; height: auto;
}
.nbs-search::placeholder { color: var(--nbs-ink2); opacity: 1; }

/* ---- Daily brief ---- */
.nbs-digest {
	margin: 20px clamp(18px, 4vw, 44px) 0; padding: 18px 22px;
	border-left: 3px solid var(--nbs-accent); border-radius: 4px 14px 14px 4px;
	background: linear-gradient(90deg, rgba(44, 70, 155, 0.14), rgba(44, 70, 155, 0.04));
	max-width: 62rem;
}
.nbs-root.nbs-root .nbs-digest-title { font-family: var(--nbs-display); font-size: 1.1rem; font-weight: 600; margin-bottom: 6px; color: var(--nbs-accent); }
.nbs-digest p { max-width: 72ch; }
.nbs-root.nbs-root .nbs-digest-note { margin-top: 8px; font-size: 0.8rem; color: var(--nbs-ink2); }

/* ---- Cards ---- */
.nbs-grid {
	display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px;
	padding: 22px clamp(18px, 4vw, 44px) 0; min-height: 120px;
	transition: opacity 0.25s ease;
}
.is-loading .nbs-grid { opacity: 0.45; }
.is-loading .nbs-grid:empty::before { content: "Tuning in…"; color: var(--nbs-ink2); font-family: var(--nbs-display); }
.nbs-card {
	--rx: 0deg; --ry: 0deg; --mx: 50%; --my: 0%;
	position: relative; display: flex; flex-direction: column; overflow: hidden;
	background: linear-gradient(160deg, #FAF8F4, var(--nbs-card) 60%);
	border: 1px solid var(--nbs-edge); border-radius: 14px;
	transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry));
	transition: transform 0.25s ease, border-color 0.25s ease;
	will-change: transform;
}
.nbs-card::after {
	content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.3s ease;
	background: radial-gradient(340px circle at var(--mx) var(--my), rgba(255, 255, 255, 0.5), transparent 65%);
}
.nbs-card:hover { border-color: var(--nbs-ink2); }
.nbs-card:hover::after { opacity: 1; }
.nbs-media { position: relative; aspect-ratio: 16 / 9; background: #E6EAF5; overflow: hidden; }
.nbs-root .nbs-media img, .nbs-media iframe { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; border: 0; display: block; }
.nbs-media img { filter: saturate(0.9) contrast(1.03); }
.nbs-root.nbs-root .nbs-play {
	position: absolute; left: 12px; bottom: 12px; cursor: pointer;
	background: rgba(23, 40, 88, 0.8); color: var(--nbs-cream); border: 1px solid var(--nbs-amber); border-radius: 999px; padding: 6px 14px; font-size: 0.85rem;
}
.nbs-body { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 9px; padding: 16px 18px 18px; }
.nbs-root.nbs-root .nbs-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 0.8rem; color: var(--nbs-ink2); }
.nbs-src { color: var(--nbs-ink); font-weight: 600; }
.nbs-src::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: color-mix(in srgb, var(--c) 55%, #2C469B); margin-right: 7px; }
.nbs-flag { color: var(--nbs-paper); background: var(--nbs-ink); border-radius: 999px; padding: 1px 9px; font-weight: 600; }
.nbs-root.nbs-root .nbs-title { font-family: var(--nbs-display); font-weight: 500; font-size: 1.14rem; line-height: 1.28; letter-spacing: 0; }
.nbs-root.nbs-root .nbs-title a { color: var(--nbs-ink); text-decoration: none; background: linear-gradient(var(--nbs-accent), var(--nbs-accent)) 0 100% / 0 1px no-repeat; transition: background-size 0.3s ease, color 0.2s ease; }
.nbs-root.nbs-root .nbs-title a:hover { color: var(--nbs-accent); background-size: 100% 1px; }
.nbs-title a::after { content: ""; position: absolute; inset: 0; }
.nbs-play, .nbs-listen, .nbs-body audio { position: relative; z-index: 2; }
.nbs-root.nbs-root .nbs-brief, .nbs-root.nbs-root .nbs-excerpt { font-size: 0.92rem; color: var(--nbs-ink); }
.nbs-root.nbs-root .nbs-excerpt { color: var(--nbs-ink2); }
.nbs-ai { display: inline-block; margin-right: 8px; padding: 0 8px; font-size: 0.72rem; line-height: 1.6; color: var(--nbs-accent); border: 1px solid rgba(44, 70, 155, 0.55); border-radius: 999px; vertical-align: 1px; }
.nbs-root.nbs-root .nbs-listen { align-self: flex-start; }
.nbs-body audio { width: 100%; height: 36px; }

.nbs-lead { border-radius: 18px; }
@media (min-width: 720px) {
	.nbs-lead { grid-column: span 2; flex-direction: row; }
	.nbs-lead .nbs-media { flex: 0 0 44%; aspect-ratio: auto; min-height: 250px; }
	.nbs-lead .nbs-body { justify-content: center; padding: 24px 26px; gap: 12px; }
	.nbs-root.nbs-root .nbs-lead .nbs-title { font-size: clamp(1.3rem, 1.9vw, 1.6rem); font-weight: 600; line-height: 1.18; }
}

.nbs-root.nbs-root .nbs-status { padding: 0 clamp(18px, 4vw, 44px); color: var(--nbs-ink2); }
.nbs-root.nbs-root .nbs-status:not(:empty) { padding-top: 18px; }
.nbs-root.nbs-root .nbs-more { display: block; margin: 26px auto 0; padding: 10px 24px; }
.nbs-root.nbs-root .nbs-more[hidden], .nbs-digest[hidden] { display: none; }

/* ---- Ticker ---- */
.nbs-layout-ticker { padding: 0; border-radius: 999px; background: var(--nbs-bg); color: var(--nbs-cream); }
.nbs-ticker { display: flex; align-items: stretch; border: 1px solid var(--nbs-line); border-radius: 999px; overflow: hidden; }
.nbs-ticker-tag { flex: none; display: flex; align-items: center; padding: 0 18px; font-family: var(--nbs-display); font-weight: 600; color: var(--nbs-bg); background: var(--nbs-amber); }
.nbs-ticker-view { flex: 1; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.nbs-ticker-track { display: inline-flex; white-space: nowrap; animation: nbs-slide 60s linear infinite; }
.nbs-ticker:hover .nbs-ticker-track, .nbs-ticker:focus-within .nbs-ticker-track { animation-play-state: paused; }
@keyframes nbs-slide { to { transform: translateX(-50%); } }
.nbs-root.nbs-root .nbs-ticker-item { display: inline-block; padding: 10px 22px; color: var(--nbs-cream); text-decoration: none; font-size: 0.92rem; }
.nbs-root.nbs-root .nbs-ticker-item:hover { color: var(--nbs-amber); }
.nbs-ticker-src { color: var(--c); font-weight: 600; margin-right: 10px; }

@media (max-width: 600px) {
	.nbs-root { border-radius: 14px; }
	.nbs-tools { width: 100%; }
	.nbs-root.nbs-root .nbs-search { flex: 1; width: auto; }
}
@media (prefers-reduced-motion: reduce) {
	.nbs-root *, .nbs-root *::before, .nbs-root *::after { animation: none !important; transition: none !important; }
	.nbs-card { transform: none; }
	.nbs-ticker-view { overflow-x: auto; }
}
