/* ==========================================================================
   Happyuky7 | Links - stylesheet
   --------------------------------------------------------------------------
   Replaces style-antiguo.css + style-mobil-antiguo.css +
   style-4k-resolution-antiguo.css (kept in the repo for reference).

   Why it was rewritten: the old sheets positioned everything with hard-coded
   pixel offsets (`margin-left: 500px`, `margin-top: -105px`, a 650px fixed
   card) and then patched each screen size in a separate file. That only ever
   lined up at one viewport width.

   This one is mobile-first and fluid: one file, flex/grid instead of negative
   margins, clamp() instead of per-resolution overrides. It scales from ~320px
   to 4K without a breakpoint for every size.

   The palette is unchanged - same colours as the old sheet.
   ========================================================================== */

/* ---------- Design tokens ------------------------------------------------ */

:root {
	--bg: #1d2633;
	--surface: #32445e;
	--footer-bg: #1a1a1a;

	--text: #ffffff;
	--text-muted: #cfcfcf;
	--profile-name: #67df9b;
	--profile-handle: #c7c7c7;
	--card-title: #68c67d;
	--card-cta: #35d3b9;
	--accent: #42ff4b;

	--radius-card: 20px;
	--radius-link: 28px;

	/* The shell never exceeds 650px (the old fixed width) but is free to
	   shrink, always keeping a gutter. */
	--shell: min(650px, 100% - 2rem);

	--font-ui: Arial, Helvetica, sans-serif;
	--font-card: 'Courier New', Courier, monospace;
}

/* ---------- Reset -------------------------------------------------------- */

*,
*::before,
*::after {
	box-sizing: border-box;
}

body {
	margin: 0;
	padding: 0;
	font-family: var(--font-ui);
	background-color: var(--bg);
	color: var(--text);
	/* Nothing should ever scroll sideways. */
	overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6,
p {
	margin: 0;
}

ul {
	margin: 0;
	padding: 0;
}

li {
	list-style: none;
}

a {
	color: var(--text);
	text-decoration: none;
}

img {
	max-width: 100%;
}

:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

/* ---------- Language switcher -------------------------------------------- */

.lang-switcher {
	position: fixed;
	top: 10px;
	right: 10px;
	z-index: 1000;
	padding: 6px 8px;
	border-radius: 8px;
}

.lang-switcher-label {
	display: block;
	margin-bottom: 2px;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .5px;
	color: #ccc;
	cursor: pointer;
}

.lang-switcher-select {
	padding: 4px 6px;
	border: 1px solid #555;
	border-radius: 6px;
	background-color: #2c3e50;
	color: var(--text);
	font-size: 13px;
}

/* ---------- Profile card ------------------------------------------------- */

.profile-card {
	width: var(--shell);
	margin: clamp(24px, 6vw, 50px) auto;
	background-color: var(--surface);
	border-radius: var(--radius-card);
	box-shadow: 0 2px 5px rgba(0, 0, 0, .2);
	overflow: hidden;
}

.banner {
	width: 100%;
	/* was a fixed 250px, which cropped badly on narrow screens */
	height: clamp(130px, 34vw, 250px);
	overflow: hidden;
}

.banner img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.profile-pic {
	--size: clamp(104px, 26vw, 170px);
	width: var(--size);
	height: var(--size);
	/* pull up by ~44% of its own size, so the overlap scales with the avatar */
	margin: calc(var(--size) * -.44) auto 0;
	border: 1px solid #000;
	border-radius: 50%;
	overflow: hidden;
}

.profile-pic img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.profile-info {
	padding: clamp(14px, 4vw, 20px);
	text-align: center;
}

.profile-info h2 {
	font-size: clamp(20px, 5vw, 24px);
	color: var(--profile-name);
}

.profile-info h3 {
	margin-top: 5px;
	font-size: clamp(14px, 3.5vw, 16px);
	color: var(--profile-handle);
}

/* ---------- Link cards ---------------------------------------------------- */

.social-links {
	display: flex;
	flex-direction: column;
	gap: clamp(14px, 3.5vw, 20px);
	margin-top: clamp(14px, 4vw, 20px);
}

/* Per-network accent. The card itself only reads var(--brand), so adding a
   network means adding one line here - no new block of layout rules. */
.websitepage-buttom { --brand: #d6a147a9; }
.github-buttom      { --brand: #090a0ba9; }
.twitter-buttom     { --brand: #1da0f2a9; }
.discord-buttom     { --brand: #4b51ff7a; }
.youtube-buttom     { --brand: #ff3d3da9; }
.twitch-buttom      { --brand: #d53dffa9; }
.pixiv-buttom       { --brand: #3d8bffa9; }
.reddit-buttom      { --brand: #ff6a009d; }
.instagram-buttom   { --brand: #ff3d5aa9; }
.tiktok-buttom      { --brand: #15161bd9; }
.stackoverflow-buttom { --brand: #f48024a9; }
.whatever-buttom    { --brand: #b05ce0a9; }

.social-links > div > a {
	/* The old sheet stacked these in a column and then dragged the text back
	   up with negative margins. A two-column grid does the same job and holds
	   together at any width. */
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	align-items: center;
	gap: clamp(12px, 3.5vw, 20px);
	padding: clamp(12px, 3vw, 16px) clamp(14px, 3.5vw, 18px);
	border-radius: var(--radius-link);
	background-color: var(--brand, #090a0ba9);
	font-family: var(--font-card);
	line-height: 1.15;
	transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.social-links > div > a:hover,
.social-links > div > a:focus-visible {
	transform: translateY(-2px);
	filter: brightness(1.08);
	box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
}

.social-links > div > a:active {
	transform: translateY(0);
}

.social-links img {
	--size: clamp(60px, 17vw, 100px);
	width: var(--size);
	height: var(--size);
	border-radius: 50%;
	object-fit: cover;
	display: block;
}

/* The website card uses a square screenshot rather than a round avatar. */
.websitepage-buttom img {
	border-radius: 12px;
}

/* Not every logo is square: discord.png is 619x469 and pixiv.svg is an 82x32
   wordmark. `cover` cropped both (pixiv showed only the middle of the word).
   Fit the whole logo inside the circle instead. */
.discord-buttom img,
.pixiv-buttom img,
.tiktok-buttom img,
.stackoverflow-buttom img,
.whatever-buttom img {
	object-fit: contain;
}

.tiktok-buttom img,
.stackoverflow-buttom img,
.whatever-buttom img {
	padding: 18%;
}

.discord-buttom img {
	padding: 13%;
}

/* pixiv's mark is solid #0096FA, which would vanish against the blue card, so
   it gets a white badge behind it. */
.pixiv-buttom img {
	padding: 16%;
	background-color: #fff;
}

/* Title and handle share a line, then description, then the call to action. */
.social-links h2 {
	display: inline;
	font-size: clamp(16px, 4.2vw, 24px);
	color: var(--card-title);
}

.social-links h3 {
	display: inline;
	margin-left: .6em;
	font-size: clamp(12px, 3.2vw, 17px);
	color: var(--text-muted);
	white-space: nowrap;
}

.social-links p {
	margin-top: .55em;
	font-family: var(--font-ui);
	font-size: clamp(12.5px, 3.2vw, 17px);
	line-height: 1.3;
	color: var(--text-muted);
}

.social-links h4 {
	margin-top: .7em;
	font-size: clamp(12px, 3vw, 15px);
	color: var(--card-cta);
	text-align: center;
}

/* ---------- Back to top --------------------------------------------------- */

.arrow-up {
	position: fixed;
	right: clamp(14px, 2vw, 24px);
	bottom: clamp(14px, 2vw, 24px);
	z-index: 999;
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity .25s ease, transform .25s ease, visibility .25s;
}

.arrow-up.is-visible {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.arrow-up a {
	display: block;
	line-height: 0;
}

.arrow-up img {
	width: clamp(42px, 9vw, 56px);
	height: clamp(42px, 9vw, 56px);
	border-radius: 50%;
	transition: transform .2s ease;
}

.arrow-up a:hover img {
	transform: scale(1.08);
}

/* ---------- Footer -------------------------------------------------------- */

/* Rebuilt to match the main site's footer: a hairline rule, a transparent
   ground rather than a solid block, small muted text and the "made with" line.
   The old one was a 170px-tall box whose contents were pushed into place with
   `margin-left: 500px` / `600px`, so on anything narrower it sat off-screen. */

.footer {
	margin-top: clamp(30px, 7vw, 50px);
	padding: 0 1rem clamp(24px, 6vw, 36px);
	background-color: transparent;
	color: #d3d8de;
	font-size: clamp(12.5px, 3vw, 14px);
}

.footer::before {
	content: "";
	display: block;
	width: var(--shell);
	height: 1px;
	margin: 0 auto clamp(18px, 4vw, 28px);
	border-radius: 999px;
	background-color: rgba(66, 255, 75, .25);
}

.footer a {
	color: #9aa4b1;
	transition: color .2s ease;
}

.footer a:hover,
.footer a:focus-visible {
	color: var(--accent);
	text-decoration: underline;
}

.footer-links ul {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: clamp(10px, 3vw, 24px);
}

.footer-bottom {
	width: var(--shell);
	margin: clamp(12px, 3vw, 16px) auto 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	text-align: center;
}

.footer-made {
	display: flex;
	align-items: center;
	gap: .35em;
	flex-wrap: wrap;
	justify-content: center;
}

.footer-made a {
	color: var(--accent);
	font-weight: 600;
}

.footer-heart {
	color: var(--accent);
	animation: footer-pulse 1.8s ease-in-out infinite;
}

@keyframes footer-pulse {
	0%, 100% { opacity: 1; }
	50%      { opacity: .45; }
}

/* Side by side once there is room, like the main site. */
@media (min-width: 640px) {
	.footer-bottom {
		flex-direction: row;
		justify-content: space-between;
		text-align: left;
	}
}

/* ---------- Large screens -------------------------------------------------- */

/* The old 4K sheet re-positioned everything again. Here the layout already
   works; wide screens only need a roomier shell and slightly larger type. */
@media (min-width: 2200px) {
	:root {
		--shell: min(900px, 100% - 4rem);
	}

	.social-links img {
		--size: 130px;
	}

	.social-links h2 { font-size: 30px; }
	.social-links h3 { font-size: 21px; }
	.social-links p  { font-size: 20px; }
	.social-links h4 { font-size: 18px; }

	.profile-info h2 { font-size: 30px; }
	.profile-info h3 { font-size: 20px; }
}

@media (min-width: 3400px) {
	:root {
		--shell: min(1200px, 100% - 6rem);
	}

	.social-links img {
		--size: 170px;
	}

	.social-links h2 { font-size: 40px; }
	.social-links h3 { font-size: 28px; }
	.social-links p  { font-size: 26px; }
	.social-links h4 { font-size: 24px; }

	.profile-info h2 { font-size: 40px; }
	.profile-info h3 { font-size: 26px; }

	.arrow-up img {
		width: 90px;
		height: 90px;
	}
}

/* ---------- Very narrow phones --------------------------------------------- */

/* Below ~360px the two-column card gets too tight, so the icon moves on top. */
@media (max-width: 360px) {
	.social-links > div > a {
		grid-template-columns: minmax(0, 1fr);
		justify-items: center;
		text-align: center;
	}

	.social-links h3 {
		white-space: normal;
	}
}

/* ---------- Motion preferences ---------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .01ms !important;
		scroll-behavior: auto !important;
	}
}
