/*
 * yichengs — site styles
 * Copyright © 2023–2026 Yi-Cheng Wang
 */

/* ---------- Tokens ---------- */
:root {
	--bg: #F3F1EC;
	--bg-2: #EAE7DF;
	--surface: #FBFAF7;
	--ink: #14161B;
	--ink-2: #2B2E36;
	--muted: #5D626D;
	--line: #DCD8CE;
	--line-strong: #C5C0B4;
	--accent: #FF5A1F;
	--accent-ink: #C2410C;
	--on-accent: #14161B;
	--band: #14161B;
	--on-band: #F3F1EC;
	--grid: rgba(20, 22, 27, .055);

	--font-sans: "Noto Sans TC", system-ui, -apple-system, "Segoe UI", "Microsoft JhengHei", sans-serif;
	--font-display: "Space Grotesk", "Noto Sans TC", system-ui, sans-serif;
	--font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;

	--gutter: clamp(16px, 4vw, 32px);
	--cut: 16px;
	--header-h: 68px;
	color-scheme: light;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--bg: #111317;
		--bg-2: #171A1F;
		--surface: #191C22;
		--ink: #ECEAE4;
		--ink-2: #D2D0C9;
		--muted: #9BA1AB;
		--line: #2A2E36;
		--line-strong: #3B404A;
		--accent: #FF6A2F;
		--accent-ink: #FF8A5C;
		--band: #1B1E25;
		--on-band: #ECEAE4;
		--grid: rgba(255, 255, 255, .045);
		color-scheme: dark;
	}
}

:root[data-theme="dark"] {
	--bg: #111317;
	--bg-2: #171A1F;
	--surface: #191C22;
	--ink: #ECEAE4;
	--ink-2: #D2D0C9;
	--muted: #9BA1AB;
	--line: #2A2E36;
	--line-strong: #3B404A;
	--accent: #FF6A2F;
	--accent-ink: #FF8A5C;
	--band: #1B1E25;
	--on-band: #ECEAE4;
	--grid: rgba(255, 255, 255, .045);
	color-scheme: dark;
}

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

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

body {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: var(--font-sans);
	font-size: 1.0625rem;
	line-height: 1.75;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
button { font: inherit; }

h1, h2, h3 {
	margin: 0;
	font-family: var(--font-display);
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -.01em;
	text-wrap: balance;
}

/* 中文只在標點或空白處換行，避免把詞拆成兩行 */
:lang(zh-Hant) :is(h1, h2, h3, .hero-lead, .page-lead) { word-break: keep-all; overflow-wrap: anywhere; }

::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.container {
	width: min(100% - 2 * var(--gutter), 1120px);
	margin-inline: auto;
}

.skip-link {
	position: absolute;
	left: var(--gutter);
	top: -100px;
	z-index: 100;
	padding: 10px 16px;
	background: var(--ink);
	color: var(--bg);
	text-decoration: none;
}
.skip-link:focus { top: 12px; }

.mono { font-family: var(--font-mono); }

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-family: var(--font-mono);
	font-size: .8rem;
	font-weight: 500;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--muted);
}
.eyebrow::before {
	content: "";
	width: 8px;
	height: 8px;
	background: var(--accent);
}

/* ---------- Brand ---------- */
.brand {
	display: inline-flex;
	align-items: center;
	color: var(--ink);
	text-decoration: none;
}
.brand-logo { display: block; height: 34px; width: auto; }
.brand-mark { display: block; width: 100%; height: auto; color: var(--ink); }
.brand-logo .acc, .brand-mark .acc { fill: var(--accent); }

/* ---------- Header ---------- */
.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: color-mix(in srgb, var(--bg) 86%, transparent);
	-webkit-backdrop-filter: saturate(1.4) blur(14px);
	backdrop-filter: saturate(1.4) blur(14px);
	border-bottom: 1px solid transparent;
	transition: border-color .2s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }

.header-inner {
	display: flex;
	align-items: center;
	gap: 24px;
	height: var(--header-h);
}

.nav { margin-left: auto; }
.nav ul { display: flex; gap: 2px; list-style: none; }
.nav a {
	position: relative;
	display: block;
	padding: 8px 14px;
	font-size: .95rem;
	font-weight: 500;
	color: var(--muted);
	text-decoration: none;
	transition: color .15s ease;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"]::after {
	content: "";
	position: absolute;
	left: 14px;
	right: 14px;
	bottom: 1px;
	height: 2px;
	background: var(--accent);
}

.header-actions { display: flex; align-items: center; gap: 8px; }

.lang-switch, .icon-btn {
	display: inline-grid;
	place-items: center;
	height: 36px;
	border: 1px solid var(--line-strong);
	background: transparent;
	color: var(--ink);
	text-decoration: none;
	cursor: pointer;
	transition: border-color .15s ease, background .15s ease;
}
.lang-switch {
	padding: 0 12px;
	font-family: var(--font-mono);
	font-size: .78rem;
	font-weight: 500;
	letter-spacing: .06em;
}
.icon-btn { width: 36px; padding: 0; font-size: .9rem; }
.lang-switch:hover, .icon-btn:hover { border-color: var(--ink); }

.theme-toggle .fa-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .fa-sun { display: inline-block; }
:root[data-theme="dark"] .theme-toggle .fa-moon { display: none; }
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .theme-toggle .fa-sun { display: inline-block; }
	:root:not([data-theme="light"]) .theme-toggle .fa-moon { display: none; }
}

.nav-toggle { display: none; }

@media (max-width: 760px) {
	.header-inner { gap: 12px; }
	.brand-logo { height: 30px; }
	.nav-toggle { display: inline-grid; }
	.nav {
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		padding: 4px var(--gutter) 16px;
		background: var(--bg);
		border-bottom: 1px solid var(--line);
		opacity: 0;
		visibility: hidden;
		transform: translateY(-6px);
		transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
	}
	.nav.is-open {
		opacity: 1;
		visibility: visible;
		transform: none;
		transition: opacity .2s ease, transform .2s ease;
	}
	.nav ul { flex-direction: column; }
	.nav a {
		padding: 14px 2px;
		font-size: 1.05rem;
		border-bottom: 1px solid var(--line);
	}
	.nav li:last-child a { border-bottom: 0; }
	.nav a[aria-current="page"]::after {
		left: auto;
		right: 2px;
		top: 50%;
		bottom: auto;
		width: 8px;
		height: 8px;
		transform: translateY(-50%);
	}
	.header-actions { margin-left: auto; }
}

/* ---------- Buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
	--c: 10px;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 13px 22px;
	font-size: .98rem;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	clip-path: polygon(0 0, calc(100% - var(--c)) 0, 100% var(--c), 100% 100%, 0 100%);
	transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}
.btn i { font-size: .85em; transition: transform .2s ease; }
.btn:hover i { transform: translateX(3px); }
.btn:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--accent); }

.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--accent); color: var(--on-accent); }

.btn-ghost {
	--bc: var(--line-strong);
	color: var(--ink);
	box-shadow: inset 0 0 0 1px var(--bc);
	/* draws the 1px border along the chamfered corner */
	background: linear-gradient(225deg, transparent calc(var(--c) * .7071 - 1px), var(--bc) calc(var(--c) * .7071 - 1px), var(--bc) calc(var(--c) * .7071), transparent calc(var(--c) * .7071));
}
.btn-ghost:hover { --bc: var(--ink); }

/* ---------- Chamfered card ---------- */
.card {
	position: relative;
	isolation: isolate;
	padding: 28px;
	background: var(--line);
	clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%);
}
.card::before {
	content: "";
	position: absolute;
	inset: 1px;
	z-index: -1;
	background: var(--surface);
	clip-path: inherit;
}

/* ---------- Sections ---------- */
.section { padding: clamp(64px, 9vw, 112px) 0; }
.section + .section { padding-top: 0; }

.section-head {
	display: grid;
	grid-template-columns: auto 1fr;
	align-items: end;
	column-gap: 20px;
	row-gap: 8px;
	margin-bottom: 36px;
	padding-bottom: 18px;
	border-bottom: 1px solid var(--line);
}
.section-index {
	font-family: var(--font-mono);
	font-size: .85rem;
	font-weight: 500;
	color: var(--accent-ink);
	padding-bottom: .35em;
}
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
.section-head .section-sub {
	grid-column: 1 / -1;
	color: var(--muted);
	font-size: .98rem;
}

/* ---------- Hero ---------- */
.hero {
	position: relative;
	isolation: isolate;
	padding: clamp(48px, 8vw, 96px) 0 clamp(64px, 9vw, 112px);
}
.hero::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background-image:
		linear-gradient(var(--grid) 1px, transparent 1px),
		linear-gradient(90deg, var(--grid) 1px, transparent 1px);
	background-size: 40px 40px;
	background-position: -1px -1px;
	-webkit-mask-image: radial-gradient(ellipse 70% 70% at 30% 40%, #000 20%, transparent 75%);
	mask-image: radial-gradient(ellipse 70% 70% at 30% 40%, #000 20%, transparent 75%);
	pointer-events: none;
}

.hero-grid {
	display: grid;
	grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
	align-items: center;
	gap: clamp(40px, 6vw, 80px);
}

.hero-title {
	margin-top: 22px;
	font-size: clamp(3rem, 8vw, 5.6rem);
	line-height: 1;
	letter-spacing: -.02em;
}
.hero-title .dot { color: var(--accent); }
.hero-title .sub {
	display: block;
	margin-top: 14px;
	font-size: clamp(1.25rem, 2.6vw, 1.75rem);
	font-weight: 500;
	letter-spacing: 0;
	color: var(--muted);
}

/* 綽號：接在副名後面，用細斜線分隔 */
.alias { color: var(--ink-2); }
.alias::before {
	content: "/";
	margin: 0 .5em;
	color: var(--line-strong);
	font-weight: 400;
}

.hero-lead {
	max-width: 34em;
	margin-top: 28px;
	font-size: clamp(1.05rem, 1.6vw, 1.2rem);
	color: var(--ink-2);
}
.hero-lead > span { display: block; }
.hero .actions { margin-top: 36px; }

/* photo frame */
.hero-media {
	position: relative;
	margin: 0;
	width: 100%;
	max-width: 440px;
	justify-self: end;
}
.hero-media::before, .hero-media::after {
	content: "";
	position: absolute;
	width: 26px;
	height: 26px;
	border: 2px solid var(--accent);
	pointer-events: none;
}
.hero-media::before { top: -12px; left: -12px; border-right: 0; border-bottom: 0; }
.hero-media::after { bottom: 30px; right: -12px; border-left: 0; border-top: 0; }

.frame {
	--fc: 28px;
	position: relative;
	aspect-ratio: 4 / 5;
	overflow: hidden;
	background: var(--bg-2);
	clip-path: polygon(0 0, calc(100% - var(--fc)) 0, 100% var(--fc), 100% 100%, var(--fc) 100%, 0 calc(100% - var(--fc)));
}
.frame img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: var(--pos, 50% 50%);
	opacity: 0;
	transform: scale(1.04);
	transition: opacity .9s ease, transform 6s ease;
}
.frame img.is-active { opacity: 1; transform: none; }

.frame-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: 12px;
	font-family: var(--font-mono);
	font-size: .78rem;
	letter-spacing: .06em;
	color: var(--muted);
}
.frame-ctrl { display: flex; gap: 6px; }
.frame-ctrl .icon-btn { width: 32px; height: 32px; font-size: .75rem; }

/* ---------- Now cards ---------- */
.grid-4 {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 20px;
}

.now-card { display: flex; flex-direction: column; min-height: 220px; }
.now-card .card-icon {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	margin-bottom: 28px;
	background: var(--ink);
	color: var(--bg);
	font-size: 1.05rem;
}
.now-card:first-child .card-icon { background: var(--accent); color: var(--on-accent); }
.card-k {
	font-family: var(--font-mono);
	font-size: .75rem;
	font-weight: 500;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--muted);
}
.now-card h3 { margin-top: 6px; font-size: 1.35rem; }
.now-card .card-meta { margin-top: auto; padding-top: 18px; color: var(--ink-2); font-size: .98rem; }

/* ---------- Focus ---------- */
.focus-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 20px;
}
.focus-list { display: grid; align-content: start; gap: 28px; }
.focus-list h3 { font-size: 1.05rem; margin-bottom: 12px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; }
.chips li {
	padding: 6px 14px;
	border: 1px solid var(--line-strong);
	font-size: .95rem;
	line-height: 1.5;
	background: var(--surface);
}

.cert-card { display: flex; flex-direction: column; gap: 18px; text-decoration: none; }
.cert-card img { width: 100%; max-width: 360px; background: #fff; }
.cert-card .cert-name { font-weight: 700; font-size: 1.1rem; }
.cert-card .cert-link { display: inline-flex; align-items: center; gap: 8px; color: var(--accent-ink); font-weight: 600; font-size: .95rem; }

/* ---------- Facebook CTA ---------- */
.cta-card {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	gap: 24px;
	padding: 32px;
	text-decoration: none;
}
.cta-icon {
	display: grid;
	place-items: center;
	width: 56px;
	height: 56px;
	background: var(--ink);
	color: var(--bg);
	font-size: 1.5rem;
}
.cta-title { display: block; font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; line-height: 1.3; }
.cta-sub { display: block; margin-top: 4px; color: var(--muted); }
.cta-card:hover .cta-btn, .cta-card:focus-visible .cta-btn { background: var(--accent); color: var(--on-accent); }
.cta-card:hover .cta-btn i { transform: translateX(3px); }
.cta-card:focus-visible { outline: none; }
.cta-card:focus-visible::before { background: var(--bg-2); }

/* ---------- News band ---------- */
.band {
	background: var(--band);
	color: var(--on-band);
	border-top: 3px solid var(--accent);
}
.band-inner {
	display: flex;
	align-items: center;
	gap: 24px;
	padding: 28px 0;
}
.band time {
	flex: none;
	font-family: var(--font-mono);
	font-size: .85rem;
	color: var(--accent);
}
.band p { flex: 1; }
.band a {
	flex: none;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-weight: 600;
	text-decoration: none;
	border-bottom: 1px solid currentColor;
}
.band a:hover { color: var(--accent); }

/* ---------- Page head ---------- */
.page-head {
	position: relative;
	isolation: isolate;
	padding: clamp(48px, 7vw, 88px) 0 clamp(32px, 5vw, 56px);
	border-bottom: 1px solid var(--line);
}
.page-head::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background-image:
		linear-gradient(var(--grid) 1px, transparent 1px),
		linear-gradient(90deg, var(--grid) 1px, transparent 1px);
	background-size: 40px 40px;
	-webkit-mask-image: linear-gradient(90deg, #000, transparent 70%);
	mask-image: linear-gradient(90deg, #000, transparent 70%);
}
.page-head h1 { margin-top: 18px; font-size: clamp(2.4rem, 6vw, 4rem); letter-spacing: -.02em; }
.page-head h1 .dot { color: var(--accent); }
.page-head .page-lead { max-width: 40em; margin-top: 16px; color: var(--muted); font-size: 1.08rem; }

/* ---------- About ---------- */
.about-grid {
	display: grid;
	grid-template-columns: 300px minmax(0, 1fr);
	gap: clamp(40px, 6vw, 72px);
	padding: clamp(40px, 6vw, 72px) 0 clamp(64px, 9vw, 112px);
}

.profile { position: sticky; top: calc(var(--header-h) + 24px); align-self: start; }
.profile .frame { --fc: 20px; aspect-ratio: 1; }
.profile .frame img { opacity: 1; transform: none; }
.profile h2 { margin-top: 22px; font-size: 1.6rem; }
.profile .profile-en { color: var(--muted); font-family: var(--font-display); font-weight: 500; }
.kv { list-style: none; margin-top: 20px; border-top: 1px solid var(--line); }
.kv li {
	display: grid;
	grid-template-columns: 64px 1fr;
	gap: 12px;
	padding: 10px 0;
	border-bottom: 1px solid var(--line);
	font-size: .93rem;
}
.kv .k { font-family: var(--font-mono); font-size: .75rem; letter-spacing: .06em; color: var(--muted); padding-top: .2em; text-transform: uppercase; }
.kv a { text-decoration: none; border-bottom: 1px solid var(--line-strong); }
.kv a:hover { border-color: var(--accent); }
.profile .actions { margin-top: 22px; }

.about-body { display: grid; gap: clamp(48px, 6vw, 72px); }
.block h2 {
	display: flex;
	align-items: baseline;
	gap: 14px;
	margin-bottom: 22px;
	font-size: 1.45rem;
}
.block h2 .section-index { padding: 0; }

.role-list { display: grid; gap: 12px; list-style: none; }
.role-list li {
	display: grid;
	grid-template-columns: 140px 1fr;
	gap: 16px;
	align-items: baseline;
	padding: 16px 20px;
	background: var(--surface);
	border: 1px solid var(--line);
	border-left: 3px solid var(--accent);
}
.role-list .when { font-family: var(--font-mono); font-size: .8rem; color: var(--muted); }
.role-list .what { font-weight: 700; }
.role-list .what span { font-weight: 400; color: var(--muted); }

.timeline { list-style: none; border-left: 1px solid var(--line-strong); margin-left: 4px; }
.timeline li { position: relative; padding: 0 0 24px 26px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
	content: "";
	position: absolute;
	left: -5px;
	top: .55em;
	width: 9px;
	height: 9px;
	background: var(--bg);
	border: 2px solid var(--ink-2);
}
.timeline li.is-current::before { background: var(--accent); border-color: var(--accent); }
.tl-when { display: block; font-family: var(--font-mono); font-size: .78rem; letter-spacing: .04em; color: var(--muted); }
.tl-title { font-weight: 700; }
.tl-sub { color: var(--muted); font-size: .95rem; }

.list-plain { list-style: none; display: grid; gap: 10px; }
.list-plain li { position: relative; padding-left: 22px; }
.list-plain li::before {
	content: "";
	position: absolute;
	left: 2px;
	top: .75em;
	width: 8px;
	height: 2px;
	background: var(--accent);
}

.skill-groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.skill-groups h3 { font-size: 1rem; margin-bottom: 12px; }

.cert-inline { display: inline-block; margin-top: 28px; }
.cert-inline img { width: 100%; max-width: 380px; border: 1px solid var(--line); background: #fff; }

.prose { display: grid; gap: 28px; }
.prose h3 { font-size: 1.1rem; margin-bottom: 8px; }
.prose p { color: var(--ink-2); max-width: 42em; }

/* ---------- Links ---------- */
.links-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
	gap: 16px;
	padding: clamp(40px, 6vw, 72px) 0 clamp(64px, 9vw, 112px);
}
.link-card {
	display: grid;
	grid-template-columns: 44px minmax(0, 1fr) auto;
	align-items: center;
	gap: 16px;
	padding: 20px 22px;
	text-decoration: none;
	transition: background .2s ease;
}
.link-card:hover { background: var(--ink); }
.link-card:focus-visible { outline: none; background: var(--accent); }
.link-card .lc-icon {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	background: var(--bg-2);
	font-size: 1.25rem;
}
.link-card .lc-name { display: block; font-weight: 700; }
.link-card .lc-handle {
	display: block;
	overflow: hidden;
	font-family: var(--font-mono);
	font-size: .8rem;
	color: var(--muted);
	white-space: nowrap;
	text-overflow: ellipsis;
}
.link-card .lc-arrow { color: var(--muted); font-size: .85rem; transition: transform .2s ease, color .2s ease; }
.link-card:hover .lc-arrow { color: var(--accent); transform: translate(2px, -2px); }

/* ---------- Business card ---------- */
.bizcard { padding: clamp(40px, 6vw, 72px) 0 clamp(64px, 9vw, 112px); }
.bizcard-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 24px;
}
.bizcard-face { margin: 0; }
.bizcard-face img {
	width: 100%;
	height: auto;
	border: 1px solid var(--line);
	border-radius: 4px;
	box-shadow: 0 1px 2px rgba(20, 22, 27, .06), 0 20px 40px -24px rgba(20, 22, 27, .45);
}
.bizcard-face figcaption {
	margin-top: 12px;
	font-family: var(--font-mono);
	font-size: .78rem;
	letter-spacing: .06em;
	color: var(--muted);
}
.bizcard .actions { margin-top: 32px; }

/* ---------- History ---------- */
.history { list-style: none; padding: clamp(40px, 6vw, 72px) 0 clamp(64px, 9vw, 112px); }
.history li {
	display: grid;
	grid-template-columns: 150px minmax(0, 1fr) 180px;
	gap: 24px;
	align-items: center;
	padding: 22px 0;
	border-bottom: 1px solid var(--line);
}
.history li:first-child { border-top: 1px solid var(--line); }
.history time { font-family: var(--font-mono); font-size: .9rem; color: var(--muted); }
.history li:first-child time { color: var(--accent-ink); }
.history .h-desc { font-size: 1.02rem; }
.history .h-score { display: flex; align-items: center; gap: 12px; font-family: var(--font-mono); font-size: .8rem; color: var(--muted); }
.meter {
	flex: 1;
	height: 8px;
	background: repeating-linear-gradient(90deg, var(--line-strong) 0 calc(10% - 2px), transparent calc(10% - 2px) 10%);
	position: relative;
}
.meter span {
	position: absolute;
	inset: 0 auto 0 0;
	width: calc(var(--v) * 10%);
	background: repeating-linear-gradient(90deg, var(--ink) 0 calc(100% / var(--v) - 2px), transparent calc(100% / var(--v) - 2px) calc(100% / var(--v)));
}
.history li:first-child .meter span {
	background: repeating-linear-gradient(90deg, var(--accent) 0 calc(100% / var(--v) - 2px), transparent calc(100% / var(--v) - 2px) calc(100% / var(--v)));
}

/* ---------- Error ---------- */
.error-page {
	display: grid;
	justify-items: center;
	text-align: center;
	padding: clamp(56px, 10vw, 120px) 0;
}
.error-page .brand-mark { width: 132px; }
.error-code {
	margin-top: 24px;
	font-family: var(--font-mono);
	font-size: .9rem;
	letter-spacing: .1em;
	color: var(--accent-ink);
}
.error-page h1 { margin-top: 10px; font-size: clamp(1.8rem, 4.5vw, 2.6rem); }
.error-page p { max-width: 32em; margin-top: 14px; color: var(--muted); }
.error-page .actions { justify-content: center; margin-top: 32px; }

/* ---------- Footer ---------- */
.site-footer {
	margin-top: auto;
	border-top: 1px solid var(--line);
	background: var(--bg-2);
	font-size: .95rem;
}
.footer-inner {
	display: grid;
	grid-template-columns: 1.4fr 1fr 1fr;
	gap: 32px;
	padding: 48px 0 40px;
}
.footer-inner .brand-logo { height: 28px; }
.footer-note { margin-top: 14px; color: var(--muted); max-width: 26em; }
.footer-col h2 {
	margin-bottom: 12px;
	font-family: var(--font-mono);
	font-size: .75rem;
	font-weight: 500;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--muted);
}
.footer-col ul:not(.social) { list-style: none; display: grid; gap: 6px; }
.footer-col a { text-decoration: none; }
.footer-col a:hover { color: var(--accent-ink); }

.social { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; }
.footer-col .social { margin-top: 14px; }
.social a {
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	border: 1px solid var(--line-strong);
	text-decoration: none;
	transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.social a:hover { background: var(--ink); border-color: var(--ink); color: var(--bg); }

.footer-bottom {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 12px;
	padding: 18px 0 28px;
	border-top: 1px solid var(--line);
	font-family: var(--font-mono);
	font-size: .78rem;
	color: var(--muted);
}
.footer-bottom a { text-decoration: none; }
.footer-bottom a:hover { color: var(--ink); }

/* ---------- Reveal ---------- */
.js .reveal {
	opacity: 0;
	transform: translateY(14px);
	transition: opacity .7s ease, transform .7s ease;
}
.js .reveal.is-visible { opacity: 1; transform: none; }

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

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
	.hero-grid { grid-template-columns: 1fr; }
	.hero-media { justify-self: start; max-width: 520px; }
	.hero-media .frame { aspect-ratio: 5 / 4; }
	.grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.now-card { min-height: 0; }
	.now-card .card-icon { margin-bottom: 18px; }
	.focus-grid { grid-template-columns: 1fr; }
	.bizcard-grid { grid-template-columns: 1fr; max-width: 560px; }
	.about-grid { grid-template-columns: 1fr; }
	.profile { position: static; display: grid; grid-template-columns: 160px 1fr; column-gap: 24px; align-items: start; }
	.profile .frame { grid-row: span 4; }
	.profile h2 { margin-top: 0; }
	.skill-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.footer-inner { grid-template-columns: 1fr 1fr; }
	.footer-brand { grid-column: 1 / -1; }
	.history li { grid-template-columns: 120px minmax(0, 1fr); }
	.history .h-score { grid-column: 2; }
}

@media (max-width: 560px) {
	body { font-size: 1rem; }
	.hero-media::after { right: -8px; }
	.hero-media::before { left: -8px; }
	.card { padding: 22px; }
	.grid-4 { grid-template-columns: 1fr; }
	.band-inner { flex-direction: column; align-items: flex-start; gap: 10px; }
	.cta-card { grid-template-columns: auto minmax(0, 1fr); gap: 18px; padding: 24px; }
	.cta-btn { grid-column: 1 / -1; justify-self: start; }
	.profile { grid-template-columns: 1fr; }
	.profile .frame { max-width: 220px; grid-row: auto; }
	.profile h2 { margin-top: 20px; }
	.role-list li { grid-template-columns: 1fr; gap: 4px; }
	.skill-groups { grid-template-columns: 1fr; }
	.footer-inner { grid-template-columns: 1fr; }
	.history li { grid-template-columns: 1fr; gap: 8px; }
	.history .h-score { grid-column: auto; }
}
