/* ==========================================================================
   NEXA-PING design system — home
   The title with the quick start bar, beside the map of the network with its figures, on one
   rounded panel; the tools as cards under a segmented filter.
   ========================================================================== */

/* ---- hero ---------------------------------------------------------------- */

/* one rounded panel of soft sky. Its padding keeps what is on it away from its edge; .hero-bg
   keeps the lights behind inside its corners. It is a layer of its own, over what follows it:
   the list of tools the quick bar opens may reach past it */
.hero {
	position: relative; isolation: isolate; z-index: 5;
	margin-top: 4px; padding: clamp(26px, 3.1vw, 44px) clamp(22px, 3.1vw, 44px) clamp(24px, 2.8vw, 40px);
	border-radius: 32px;
	background: linear-gradient(128deg, var(--hero-1) 0%, var(--hero-2) 48%, var(--hero-3) 100%);
	border: 1px solid var(--hero-line);
	box-shadow: inset 0 1px 0 var(--hero-rim), var(--sh-hero);
}
/* two lights along the top, one of the accent and one of the colour it fades into: they drift
   slowly, and give the panel its air. Each is placed by its own size, so that it sits the same
   way on a panel of any height */
.hero-bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; border-radius: inherit; pointer-events: none; }
.hero-orb { position: absolute; display: block; width: var(--size); height: var(--size); border-radius: 50%; filter: blur(64px); animation: nx-drift 18s ease-in-out infinite; }
.hero-orb--1 { --size: clamp(280px, 58%, 880px); left: -12%; top: calc(var(--size) * -0.5); background: var(--glow-1); opacity: 0.75; }
.hero-orb--2 { --size: clamp(280px, 58%, 880px); right: -8%; top: calc(var(--size) * -0.56); background: var(--glow-2); opacity: 0.7; animation-delay: -6s; }

/* the copy stands in the middle of the height of the map. Its lines keep their own heights — a
   grid given more height than it needs shares the rest out among its lines, and the bar would
   be stretched with its input and its button left at the top of it */
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); gap: clamp(24px, 2.8vw, 40px); align-items: center; }
.hero-copy { position: relative; z-index: 2; display: grid; justify-items: start; align-content: center; min-width: 0; }
.hero-tag {
	display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 14px 0 10px;
	border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-1);
	color: var(--accent-ink); font-size: 13px; font-weight: 600; white-space: nowrap;
}
.hero-tag-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft-2); animation: nx-pulse 2.4s ease-in-out infinite; }
.hero-title { margin-top: 18px; font-size: clamp(32px, 3.6vw, 50px); font-weight: 800; line-height: 1.18; letter-spacing: -0.03em; }
.hero-title em { font-style: normal; background: linear-gradient(120deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-lead { margin-top: 14px; max-width: 560px; color: var(--ink-3); font-size: 15.5px; line-height: 1.8; }

/* the quick start bar: one pill for the tool, the target and the way to begin, each its own
   height and all of them in the middle of the bar's height */
.nx-quick {
	position: relative; display: flex; align-items: center; width: 100%; max-width: 660px; min-height: 64px; margin-top: 26px; padding: 6px;
	border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-2);
	transition: box-shadow 0.25s, border-color 0.25s;
}
.nx-quick:focus-within { border-color: color-mix(in srgb, var(--accent) 50%, transparent); box-shadow: 0 0 0 5px var(--accent-ring), var(--sh-2); }
.nx-quick-tool { flex: 0 0 auto; display: flex; align-items: center; }
.nx-quick-tool-btn {
	display: inline-flex; align-items: center; gap: 8px; height: 50px; padding: 0 12px 0 6px;
	border: 0; border-radius: var(--r-pill); background: var(--surface-3); color: var(--ink); font-size: 15px; font-weight: 600; white-space: nowrap;
	transition: background 0.18s;
}
.nx-quick-tool-btn:hover, .nx-quick-tool-btn[aria-expanded="true"] { background: var(--surface-4); }
.nx-quick-tool-ic {
	--mark: var(--accent); --badge-edge: var(--surface-3);
	position: relative; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
	background: var(--surface); color: var(--accent-ink); font-size: 20px; box-shadow: 0 0 0 1px var(--line);
}
.nx-quick-tool-btn .ic-caret { font-size: 15px; color: var(--ink-4); transition: transform 0.22s var(--ease); }
.nx-quick-tool-btn[aria-expanded="true"] .ic-caret { transform: rotate(180deg); }
/* the list of tools is a panel under the whole bar, its sides the outer sides of the bar (the
   bar's own edge is a line wide, and what stands under the bar must not show past the list) */
.nx-quick-list {
	position: absolute; top: calc(100% + 10px); left: -1px; right: -1px; z-index: 40;
	display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 10px;
	border-radius: 22px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-3); animation: nx-pop 0.22s var(--ease-out);
}
.nx-quick-list[hidden] { display: none; }
@media (min-width: 1280px) {
	.nx-quick-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.nx-quick-option {
	display: flex; align-items: center; gap: 10px; min-width: 0; height: 48px; padding: 0 12px 0 8px;
	border: 0; border-radius: 14px; background: transparent; color: var(--ink-2); font-size: 14.5px; font-weight: 500; text-align: left; white-space: nowrap;
	transition: background 0.16s, color 0.16s;
}
.nx-quick-option:hover { background: var(--surface-2); color: var(--ink); }
.nx-quick-option.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.nx-quick-opt-ic { --mark: var(--ink-3); --badge-edge: var(--surface); position: relative; display: grid; place-items: center; flex: 0 0 auto; width: 32px; height: 32px; border-radius: 10px; background: var(--surface-3); color: var(--ink-2); font-size: 18px; transition: background 0.18s, color 0.18s; }
.nx-quick-option:hover .nx-quick-opt-ic { background: var(--surface-4); }
.nx-quick-option.active .nx-quick-opt-ic { background: var(--accent); color: #fff; --mark: var(--accent); --badge-edge: var(--accent); }
.nx-quick-input { flex: 1 1 auto; min-width: 0; height: 50px; padding: 0 8px 0 14px; border: 0; outline: none; background: transparent; color: var(--ink); font-size: 16px; }
.nx-quick-input::placeholder { color: var(--ink-4); }
.nx-quick-go { flex: 0 0 auto; height: 52px; padding: 0 24px 0 22px; font-size: 15.5px; }
.nx-quick-go .ic { transition: transform 0.22s var(--ease-out); }
.nx-quick-go:hover .ic { transform: translateX(3px); }

/* the visitor's own address. Where the visitor is, with the line that divides it from the
   address before it, is one piece: the two change line together, so that the word that names
   what follows is never left at the end of the line before it */
.hero-meta { margin-top: 18px; }
.nx-visitor { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; color: var(--ink-3); font-size: 13.5px; }
.nx-visitor-label { color: var(--ink-3); }
.nx-visitor-ip { color: var(--ink); font-family: var(--mono); font-size: 14.5px; font-weight: 600; }
.nx-visitor-copy { display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--ink-4); font-size: 15px; transition: background 0.16s, color 0.16s; }
.nx-visitor-copy:hover { background: var(--accent-soft); color: var(--accent-ink); }
.nx-visitor-place { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.nx-visitor-sep { flex: 0 0 1px; width: 1px; height: 14px; margin: 0 2px; background: var(--line-2); }
.nx-visitor-geo { min-width: 0; color: var(--ink-2); overflow-wrap: anywhere; }

/* the network: the map of the mainland with the places that have probes, and the figures */
.hero-visual { position: relative; display: flex; flex-direction: column; min-width: 0; overflow: hidden; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-2); }
.hero-visual-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex: 0 0 auto; padding: 20px 24px 0; }
.hero-visual-title { color: var(--ink); font-size: 16px; font-weight: 700; }
.hero-visual-note { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-3); font-size: 12.5px; }
.hero-visual-note::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); animation: nx-pulse 2.2s ease-in-out infinite; }
.hero-map { position: relative; flex: 1 1 auto; min-height: 310px; padding: 4px 14px 0; }
/* the map sizes itself to the box it is given and follows it (the script watches the box) */
.hero-map.nx-skeleton { min-height: 310px; margin: 14px 18px 0; border-radius: 18px; }
.hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); flex: 0 0 auto; margin: 8px 16px 16px; padding: 14px 0; border-radius: 16px; background: var(--surface-2); }
.hero-stat { display: grid; gap: 2px; justify-items: center; min-width: 0; padding: 0 8px; }
.hero-stat + .hero-stat { border-left: 1px solid var(--line); }
.hero-stat strong { color: var(--ink); font-size: 30px; font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.hero-stat span { color: var(--ink-3); font-size: 12.5px; }

/* ---- the tools ----------------------------------------------------------- */

.nx-tools { margin-top: 40px; }
.nx-tools-head { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 16px; }
.nx-tools-title { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.nx-tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); gap: 16px; }
.nx-tool-card {
	--tile: var(--accent);
	position: relative; display: grid; grid-template-columns: 48px minmax(0, 1fr) 20px; align-items: flex-start; gap: 14px;
	padding: 18px 18px 17px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-1);
	transition: transform 0.24s var(--ease-out), box-shadow 0.25s, border-color 0.25s;
	animation: nx-rise 0.6s var(--ease-out) backwards; animation-delay: calc(200ms + var(--i, 0) * 45ms);
}
.nx-tool-card--ipv6 { --tile: #0fb5a6; }
.nx-tool-card--batch { --tile: #7c5cf5; }
.nx-tool-card--other { --tile: #5b6b84; }
.nx-tool-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--tile) 38%, var(--line)); box-shadow: var(--sh-2); }
.nx-tool-card:active { transform: translateY(-1px) scale(0.995); }
.nx-tool-icon {
	display: grid; place-items: center; width: 48px; height: 48px; border-radius: 16px;
	background: color-mix(in srgb, var(--tile) 12%, var(--surface)); color: color-mix(in srgb, var(--tile) 85%, var(--ink));
	transition: transform 0.26s var(--ease-out), box-shadow 0.26s;
}
.nx-tool-card:hover .nx-tool-icon { transform: scale(1.06) rotate(-3deg); box-shadow: 0 10px 20px -10px color-mix(in srgb, var(--tile) 60%, transparent); }
.nx-tool-ic { --mark: var(--tile); --badge-edge: color-mix(in srgb, var(--tile) 12%, var(--surface)); position: relative; display: grid; place-items: center; font-size: 26px; }
.nx-tool-text { display: grid; gap: 3px; min-width: 0; }
.nx-tool-name { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--ink); font-size: 15.5px; font-weight: 600; line-height: 1.4; }
.nx-tool-badge { height: 21px; background: color-mix(in srgb, var(--tile) 13%, transparent); color: color-mix(in srgb, var(--tile) 85%, var(--ink)); font-size: 11.5px; }
.nx-tool-desc { color: var(--ink-3); font-size: 13px; line-height: 1.65; }
.nx-tool-go {
	display: grid; place-items: center; width: 22px; height: 22px; margin-top: 0; color: var(--ink-4); font-size: 16px; border-radius: 50%;
	transition: color 0.2s, background 0.2s, transform 0.24s var(--ease-out);
}
.nx-tool-card:hover .nx-tool-go { color: var(--accent-ink); background: var(--accent-soft); transform: translate(1px, -1px); }
.nx-tool-empty { margin-top: 16px; color: var(--ink-3); font-size: 14px; text-align: center; }

/* ---- sponsors and friend links ------------------------------------------- */

/* two titled blocks under the tools: the places of the sponsors, six to a line on a desk, and
   the friend links as pills; where to ask for a place stands at the right of a title */
.nx-partners { display: grid; gap: 26px; margin-top: 46px; }
.nx-partners-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.nx-partners-apply {
	display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 13px 0 15px; border: 1px solid var(--line); border-radius: var(--r-pill);
	background: var(--surface); color: var(--ink-3); font-size: 13px; font-weight: 600; white-space: nowrap;
	transition: color 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.2s var(--ease);
}
.nx-partners-apply .ic { font-size: 15px; transition: transform 0.22s var(--ease-out); }
.nx-partners-apply:hover { color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); box-shadow: var(--sh-1); }
.nx-partners-apply:hover .ic { transform: translateX(2px); }
.nx-sponsor-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
/* the place of a sponsor: its mark whole in the middle, never stretched; without a mark that
   loads, its name */
.nx-slot {
	display: grid; place-items: center; min-width: 0; height: 78px; padding: 12px 18px; overflow: hidden;
	border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--sh-1);
	transition: transform 0.24s var(--ease-out), box-shadow 0.25s, border-color 0.25s;
}
.nx-slot-logo { display: block; max-width: 100%; max-height: 46px; object-fit: contain; }
.nx-slot-name { display: none; color: var(--ink); font-size: 15px; font-weight: 700; text-align: center; overflow-wrap: anywhere; }
.nx-slot-logo[hidden] + .nx-slot-name { display: block; }
.nx-slot:not(.nx-slot--empty):hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 34%, var(--line)); box-shadow: var(--sh-2); }
/* a mark is drawn for a light ground: in the dark appearance a taken place stays a white plate,
   and the name that stands in for a mark is inked for it */
[data-theme="dark"] .nx-slot:not(.nx-slot--empty) { background: #fff; border-color: transparent; }
[data-theme="dark"] .nx-slot:not(.nx-slot--empty) .nx-slot-name { color: #1a2236; }
[data-theme="dark"] .nx-slot:not(.nx-slot--empty):hover { border-color: color-mix(in srgb, var(--accent) 38%, #fff); }
/* a place kept for a sponsor to come: outlined, not a card — a round mark with a cross, its
   name beside it, together in the middle — and a way to ask where there is one */
.nx-slot--empty {
	display: flex; align-items: center; justify-content: center; gap: 9px; height: auto; min-height: 78px; padding: 12px 10px; overflow: hidden;
	border: 1.5px dashed var(--line-2); border-radius: 18px; background: transparent; box-shadow: none; color: var(--ink-3);
	font-size: 13.5px; font-weight: 500; white-space: nowrap;
	transition: color 0.2s, border-color 0.2s, background 0.2s;
}
/* the mark is a round chip with a cross, the size given whole (every box here counts its padding in) */
.nx-slot--empty .ic { flex: 0 0 auto; width: 28px; height: 28px; padding: 7px; border-radius: 50%; background: var(--surface); color: var(--ink-3); box-shadow: 0 0 0 1px var(--line); transition: background 0.2s, color 0.2s, box-shadow 0.2s; }
a.nx-slot--empty:hover { color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: color-mix(in srgb, var(--accent) 5%, transparent); }
.nx-friends { display: flex; flex-wrap: wrap; gap: 10px; }
.nx-friend {
	display: inline-flex; align-items: center; height: 40px; padding: 0 18px; border: 1px solid var(--line); border-radius: var(--r-pill);
	background: var(--surface); box-shadow: var(--sh-1); color: var(--ink-2); font-size: 13.5px; font-weight: 500; white-space: nowrap;
	transition: color 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.2s var(--ease-out);
}
.nx-friend:hover { color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); box-shadow: var(--sh-2); transform: translateY(-1px); }

/* ---- responsive ---------------------------------------------------------- */

/* the map goes under the copy while the two columns would leave the bar too little for a target */
@media (max-width: 1240px) {
	.hero-grid { grid-template-columns: minmax(0, 1fr); gap: 26px; }
	.hero-lead, .nx-quick { max-width: 720px; }
}
/* six places to a line leave too little for a mark on a tablet */
@media (max-width: 1024px) {
	.nx-sponsor-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
	.hero { padding: 24px 16px 22px; border-radius: 26px; }
	.hero-title { font-size: 30px; }
	.hero-lead { font-size: 14.5px; }
	/* the bar takes two lines: the tool over the target and the way to begin */
	.nx-quick { flex-wrap: wrap; border-radius: 26px; margin-top: 20px; min-height: 0; }
	.nx-quick-tool { flex: 1 0 100%; margin: 0 6px; padding: 2px 0 8px; border-bottom: 1px solid var(--line); }
	/* the tool is one row of the bar: its mark and its name at the left, the way to open the list at the right */
	.nx-quick-tool-btn { width: 100%; height: 44px; justify-content: flex-start; padding: 0 10px 0 6px; background: transparent; }
	.nx-quick-tool-btn .ic-caret { margin-left: auto; }
	.nx-quick-tool-btn:hover, .nx-quick-tool-btn[aria-expanded="true"] { background: transparent; }
	.nx-quick-input { flex: 1 0 calc(100% - 66px); height: 48px; padding-left: 10px; font-size: 16px; }
	.nx-quick-go { flex: 0 0 52px; width: 52px; height: 52px; margin-left: auto; padding: 0; }
	.nx-quick-go span { display: none; }
	.nx-quick-list { grid-template-columns: minmax(0, 1fr); }
	.hero-map { min-height: 240px; padding: 0 6px; }
	.hero-map.nx-skeleton { min-height: 240px; }
	.hero-visual-head { padding: 16px 16px 0; }
	.hero-stats { margin: 6px 10px 12px; }
	.hero-stat strong { font-size: 24px; }
	.nx-tools { margin-top: 28px; }
	.nx-tool-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
	.nx-partners { gap: 22px; margin-top: 30px; }
	.nx-partners-head { margin-bottom: 12px; }
	/* the room the small screens give a page under what it holds is not wanted before the footer either */
	.nx-main.nx-main--home { padding-bottom: 0; }
	.nx-sponsor-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
	.nx-slot { height: 66px; padding: 10px 12px; border-radius: 15px; }
	.nx-slot--empty { min-height: 66px; padding: 10px 6px; border-radius: 15px; gap: 8px; font-size: 12.5px; }
	.nx-slot-logo { max-height: 38px; }
	.nx-slot--empty .ic { width: 24px; height: 24px; padding: 6px; }
}
@media (max-width: 480px) {
	/* where the visitor is has a line of its own, without the one that divides it on a desk */
	.nx-visitor-place { flex: 1 0 100%; }
	.nx-visitor-sep { display: none; }
	/* the five categories share the line evenly */
	.nx-home-filter { display: flex; width: 100%; }
	.nx-home-filter > button { flex: 1 1 0; min-width: 0; padding: 0 6px; font-size: 12.5px; }
	.nx-sponsor-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.nx-partners-apply { height: 32px; padding: 0 11px 0 13px; }
}
