@import url("https://fonts.googleapis.com/css2?family=Chiron+Sung+HK:wght@300;400;500;700&display=swap");

:root {
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-alt: #f5f5f5;
    --ink: #000000;
    --ink-soft: #666666;
    --brand: #808080;
    --brand-deep: #555555;
    --accent: #999999;
    --accent-soft: #cccccc;
    --line: #e0e0e0;
    --danger: #d32f2f;
    --ok: #388e3c;
    --shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 52px rgba(0, 0, 0, 0.15);
    --radius: 18px;
    --radius-sm: 12px;
    --transition: 0.3s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Chiron Sung HK", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
    background: #ffffff;
    color: var(--ink);
    line-height: 1.8;
    position: relative;
    isolation: isolate;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -3;
    opacity: 0;
}

h1,
h2,
h3 {
    font-family: "Chiron Sung HK", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
    line-height: 1.3;
    color: var(--ink);
}

a {
    color: var(--brand);
    text-decoration-color: rgba(31, 98, 112, 0.35);
    text-underline-offset: 0.14em;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: #000;
    color: #fff;
    padding: 10px 14px;
    z-index: 999;
}

.skip-link:focus {
    left: 10px;
}

.navbar {
    position: sticky;
    top: 0;
    z-index: 90;
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid var(--line);
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 40px;
    justify-content: space-between;
    flex-wrap: wrap;
}

.logo {
    font-weight: 700;
    letter-spacing: 0.02em;
    text-decoration: none;
    color: var(--ink);
    font-size: 1.1rem;
    padding: 10px 14px;
    border-radius: 999px;
    background: transparent;
    border: 1px solid var(--line);
}

.a11y-toggle {
    border: 1px solid var(--line);
    background: var(--brand);
    color: #fff;
    border-radius: 999px;
    padding: 9px 14px;
    cursor: pointer;
    font-size: 0.85rem;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.1);
}

.menu {
    list-style: none;
    display: flex;
    gap: 28px;
}

.menu a {
    text-decoration: none;
    color: var(--ink);
    padding-bottom: 2px;
    border-bottom: 1px solid transparent;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all var(--transition);
}

.menu a:hover,
.menu a.active {
    color: var(--brand);
    border-color: var(--brand);
}

.menu-item-with-dropdown {
    position: relative;
}

.menu-item-with-dropdown .menu-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.dropdown-toggle {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--ink-soft);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: 999px;
    transition: transform var(--transition);
    display: inline-block;
    line-height: 1;
}

.dropdown-toggle:hover {
    color: var(--ink);
}

.menu-item-with-dropdown.open .dropdown-toggle {
    transform: rotate(180deg);
}

.menu-item-with-dropdown:hover .dropdown-toggle {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    list-style: none;
    padding: 8px 0;
    margin-top: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all var(--transition);
    z-index: 100;
    min-width: 140px;
}

.menu-item-with-dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.menu-item-with-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.menu-item-with-dropdown.active-dropdown .menu-link,
.menu-item-with-dropdown.active-dropdown .dropdown-toggle,
.dropdown-menu a.active {
    color: var(--ink);
}

.menu-item-with-dropdown.active-dropdown .menu-link,
.dropdown-menu a.active {
    border-color: var(--brand-deep);
}

.dropdown-menu a.active {
    background: var(--surface-alt);
    font-weight: 700;
}

.dropdown-menu a {
    display: block;
    padding: 10px 18px;
    text-decoration: none;
    color: var(--ink);
    font-size: 0.9rem;
    font-weight: 400;
    border: none;
    transition: background-color var(--transition), color var(--transition);
}

.dropdown-menu a:hover {
    background-color: var(--surface-alt);
    color: var(--ink);
}

.hero {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border-bottom: 1px solid var(--line);
    padding: 60px 18px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 12% auto auto 8%;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    border: 0;
    background: transparent;
}

.hero::after {
    content: "";
    position: absolute;
    inset: auto 8% 10% auto;
    width: 260px;
    height: 260px;
    border-radius: 32px;
    background: transparent;
    transform: rotate(12deg);
    filter: blur(1px);
}

.hero-content {
    background: transparent;
    border-radius: 0;
    color: var(--ink);
    padding: 0;
    box-shadow: none;
    max-width: 800px;
    position: relative;
    z-index: 1;
}

.eyebrow {
    font-weight: 500;
    letter-spacing: 0.08em;
    margin-bottom: 16px;
    color: var(--ink-soft);
    text-transform: uppercase;
    font-size: 0.85rem;
}

.hero-content h1 {
    font-size: clamp(2.2rem, 6vw, 3.6rem);
    color: var(--ink);
    margin-bottom: 16px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.hero-content p {
    font-size: 1.2rem;
    color: var(--ink-soft);
    margin-bottom: 32px;
    line-height: 1.6;
}

.hero-actions {
    margin-top: 32px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.cta-button {
    text-decoration: none;
    color: #fff;
    background: var(--brand);
    border: 1px solid var(--brand);
    padding: 12px 28px;
    border-radius: 999px;
    font-weight: 500;
    letter-spacing: 0.05em;
    transition: all var(--transition);
    text-transform: uppercase;
    font-size: 0.9rem;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1);
}

.cta-button:hover {
    transform: translateY(-2px);
    background: var(--brand-deep);
    color: #fff;
}

.cta-ghost {
    background: transparent;
    border-color: var(--brand);
    color: var(--brand);
    box-shadow: none;
}

.featured {
    padding: 80px 18px;
    background: #ffffff;
    max-width: 1200px;
    margin: 0 auto;
}

.featured h2 {
    font-size: clamp(2rem, 4vw, 2.8rem);
    margin-bottom: 0;
    text-align: center;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 60px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-radius: 999px;
    background: transparent;
    border: 1px solid var(--line);
    box-shadow: none;
}

.featured h2::before,
.cta-section h2::before,
.media-block h2::before,
.contact-info h2::before,
.cv-main .card h2::before,
.footer-section h3::before {
    content: "✦";
    display: inline-grid;
    place-items: center;
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 999px;
    color: #fff;
    background: var(--brand);
    box-shadow: 0 10px 18px rgba(0, 0, 0, 0.1);
    flex: 0 0 auto;
}

.cta-section h2::before {
    content: "↗";
}

.media-block h2::before {
    content: "◫";
}

.contact-info h2::before,
.cv-main .card h2::before {
    content: "▣";
}

.footer-section h3::before {
    content: "›";
    width: 1.5rem;
    height: 1.5rem;
    background: var(--brand);
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
}

.featured-card {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 12;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.featured-card .card-link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    text-decoration: none;
}

.featured-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.featured-card .digital-preview {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 24px 20px;
    background:
        radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.28), transparent 32%),
        linear-gradient(135deg, #2f6cf6 0%, #1d2f75 55%, #0b1020 100%);
    color: #fff;
}

.featured-card .digital-preview span {
    font-size: 0.88rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    opacity: 0.84;
}

.featured-card .digital-preview strong {
    display: block;
    font-size: 2rem;
    line-height: 1;
    margin-top: 10px;
}

.featured-card:hover img {
    transform: scale(1.02);
}

.card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(17, 25, 33, 0.88), rgba(17, 25, 33, 0));
    color: #fff;
    padding: 40px 20px 20px;
    transform: translateY(20px);
    transition: transform var(--transition);
}

.featured-card:hover .card-overlay {
    transform: translateY(0);
}

.card-overlay h3 {
    font-size: 1.6rem;
    margin-bottom: 8px;
    color: #fff;
    font-weight: 500;
}

.card-overlay p {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
}

.cta-section {
    text-align: center;
    padding: 80px 18px;
    background: var(--surface-alt);
    max-width: 1200px;
    margin: 0 auto;
    border: 1px solid var(--line);
    border-radius: 28px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.cta-section::after {
    content: "";
    position: absolute;
    inset: auto -20px -20px auto;
    width: 160px;
    height: 160px;
    background: transparent;
}

.cta-section h2 {
    font-size: clamp(2rem, 4vw, 2.8rem);
    margin-bottom: 16px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.cta-section p {
    font-size: 1.1rem;
    color: var(--ink-soft);
    margin-bottom: 32px;
}

.cta-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.section {
    padding: 80px 18px;
    max-width: 1200px;
    margin: 0 auto;
}

.muted {
    background: var(--surface-alt);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
}

.section h1 {
    font-size: clamp(2rem, 4vw, 2.8rem);
    margin-bottom: 16px;
    font-weight: 700;
}

.section h2 {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    margin-bottom: 40px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.section-intro {
    color: var(--ink-soft);
    margin-bottom: 32px;
    font-size: 1.05rem;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.card::before,
.cv-sidebar::before,
.contact-form::before,
.contact-info::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 5px;
    background: var(--brand);
}

.card h3 {
    margin-bottom: 12px;
    font-size: 1.3rem;
    font-weight: 700;
}

.card p {
    color: var(--ink-soft);
    line-height: 1.8;
    margin-bottom: 16px;
}

.text-link {
    display: inline-block;
    margin-top: 8px;
    font-weight: 700;
}

.cv-layout {
    display: grid;
    grid-template-columns: minmax(260px, 320px) 1fr;
    gap: 16px;
}

.cv-sidebar,
.cv-main {
    display: grid;
    gap: 16px;
}

.cv-sidebar {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    align-content: start;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.profile-pic {
    width: 132px;
    height: 132px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--line);
}

.cv-sidebar h1 {
    margin-top: 12px;
    font-size: 1.6rem;
}

.cv-sidebar h1 span {
    font-size: 1rem;
    color: var(--ink-soft);
}

.tagline {
    color: var(--ink-soft);
}

.plain-list {
    list-style: none;
    display: grid;
    gap: 8px;
}

.skill-item {
    margin-bottom: 18px;
}

.skill-head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.95rem;
}

.skill-bar {
    margin-top: 6px;
    height: 10px;
    border-radius: 999px;
    background: var(--surface-alt);
    overflow: hidden;
}

.skill-bar span {
    display: block;
    height: 100%;
    background: var(--brand);
}

.skill-bar.w-90 span {
    width: 90%;
}

.skill-bar.w-30 span {
    width: 30%;
}

.skill-bar.w-100 span {
    width: 100%;
}

.timeline {
    list-style: none;
    display: grid;
    gap: 14px;
}

.timeline.education-timeline,
.timeline.work-timeline {
    gap: 32px;
    position: relative;
    padding-left: 40px;
}

.timeline.education-timeline::before,
.timeline.work-timeline::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 12px;
    bottom: 12px;
    width: 2px;
    background: var(--brand);
}

.timeline.education-timeline li,
.timeline.work-timeline li {
    position: relative;
}

.timeline.education-timeline li::before,
.timeline.work-timeline li::before {
    content: '';
    position: absolute;
    left: -40px;
    top: 4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--surface);
    border: 3px solid var(--brand);
    box-shadow: 0 0 0 4px var(--surface-alt);
}

.meta {
    color: var(--ink-soft);
    font-size: 0.95rem;
}

.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.media-grid {
    align-items: stretch;
}

.video-stack {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

.media-block {
    margin-top: 18px;
}

.media-thumb {
    width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    margin-bottom: 12px;
}

.guard-build-cover-thumb {
    aspect-ratio: 3 / 2;
    object-fit: cover;
}

.media-player {
    width: 100%;
    margin: 10px 0;
    border-radius: var(--radius-sm);
}

.youtube-player {
    aspect-ratio: 16 / 9;
    height: auto;
    border: 0;
}

.album-link-thumb {
    display: block;
}

.album-name-link {
    color: var(--ink);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color var(--transition);
}

.album-name-link:hover {
    border-bottom-color: var(--brand);
}

body.photo-no-blue-page a,
body.photo-no-blue-page a:visited,
body.photo-no-blue-page .menu a,
body.photo-no-blue-page .logo,
body.photo-no-blue-page .dropdown-menu a,
body.photo-no-blue-page .album-name-link,
body.photo-no-blue-page .footer-section a,
body.photo-no-blue-page .social-links a {
    color: #000;
}

body.photo-no-blue-page .menu a:hover,
body.photo-no-blue-page .menu a.active,
body.photo-no-blue-page .dropdown-menu a:hover,
body.photo-no-blue-page .album-name-link:hover {
    color: #000;
    border-color: #000;
}

body.photo-no-blue-page .a11y-toggle {
    color: #fff;
}

body.photo-no-blue-page .last-updated,
body.photo-no-blue-page .last-updated time {
    color: #fff;
}

.album-back-link {
    display: inline-block;
    margin-bottom: 20px;
    font-weight: 700;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.gallery-item {
    display: block;
    border: 1px solid var(--line);
    overflow: hidden;
    background: var(--surface);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
}

.gallery-item img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
    transition: transform var(--transition);
}

.progressive-image {
    filter: blur(10px);
    transform: scale(1.02);
    transition: filter 0.35s ease, transform 0.35s ease;
}

.progressive-image[data-progressive-stage="high"] {
    filter: none;
    transform: none;
}

.gallery-item:hover img {
    transform: scale(1.02);
}

body.guard-build-page {
    background:
        linear-gradient(180deg, #f4f6f9 0%, #eef2f6 100%);
    color: #000;
    font-family: "Chiron Sung HK", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
}

body.guard-build-page a,
body.guard-build-page a:visited {
    color: #000;
}

body.guard-build-page .last-updated,
body.guard-build-page .last-updated time {
    color: #fff;
}

.guard-bg-stage {
    position: fixed;
    inset: 0;
    z-index: -2;
    overflow: hidden;
}

.guard-bg-layer {
    position: absolute;
    inset: 0;
    opacity: 0;
    background-color: #0f1b2a;
    background-size: cover;
    background-position: center;
    transform: scale(1.08);
    transition: opacity 650ms ease, transform 8s ease;
}

.guard-bg-layer.is-active {
    opacity: 1;
    transform: scale(1);
}

.guard-bg-stage::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
    linear-gradient(120deg, rgba(18, 18, 18, 0.64) 0%, rgba(42, 42, 42, 0.52) 45%, rgba(16, 16, 16, 0.7) 100%),
    radial-gradient(circle at 20% 10%, rgba(180, 180, 180, 0.18), transparent 46%),
    radial-gradient(circle at 80% 80%, rgba(120, 120, 120, 0.2), transparent 55%);
}

body.guard-build-page .navbar {
    position: relative;
    z-index: 200;
}

body.guard-build-page .section,
body.guard-build-page footer {
    position: relative;
    z-index: 1;
}

body.guard-build-page .dropdown-menu {
    z-index: 300;
}

body.guard-build-page .section {
    position: relative;
}

.guard-build-deck {
    max-width: 1050px;
    position: relative;
    z-index: 1;
}

.guard-build-back {
    color: #000;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.guard-build-hero {
    margin-bottom: 26px;
    padding: 24px 26px;
    background: rgba(255, 255, 255, 0.66);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    border: 1px solid #cad6e3;
    box-shadow: 0 16px 38px rgba(20, 32, 54, 0.08);
}

.guard-build-kicker {
    margin: 0 0 12px;
    font-size: 0.85rem;
    letter-spacing: 0.14em;
    color: #000;
    font-weight: 700;
}

.guard-build-hero h1 {
    margin: 0;
    display: flex;
    align-items: baseline;
    gap: 14px;
    font-size: clamp(2rem, 5vw, 3rem);
    line-height: 1.08;
    color: #000;
}

.guard-build-number {
    font-size: clamp(2.2rem, 8vw, 4.2rem);
    color: #000;
    font-weight: 700;
    line-height: 1;
}

.guard-build-lead {
    margin: 14px 0 0;
    max-width: 72ch;
    font-size: 1.03rem;
    line-height: 1.65;
    color: #000;
}

.guard-build-credit {
    margin: 12px 0 0;
    font-size: 0.9rem;
    color: #000;
}

.essay-slide {
    margin-top: 20px;
    padding: 18px;
    background: rgba(255, 255, 255, 0.58);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    border: 1px solid #cad6e3;
    box-shadow: 0 12px 32px rgba(18, 34, 56, 0.08);
}

.essay-slide-head {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 12px;
}

.essay-slide-no {
    margin: 0;
    font-size: 1.9rem;
    line-height: 1;
    font-weight: 700;
    color: #000;
}

.essay-slide-head h2 {
    margin: 0;
    color: #000;
    font-size: 1.45rem;
}

.essay-content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.essay-text {
    background: rgba(250, 250, 250, 0.56);
    border: 1px solid #d8e2ed;
    padding: 14px;
}

.essay-text p {
    margin: 0 0 10px;
    line-height: 1.72;
    color: #000;
}

.essay-text p:last-child {
    margin-bottom: 0;
}

.essay-images-grid {
    display: grid;
    gap: 12px;
    margin-bottom: 12px;
}

.essay-images-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.essay-images-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.essay-image {
    display: block;
    background: rgba(239, 244, 250, 0.9);
    border: 1px solid #cad6e3;
    padding: 8px;
}

.essay-image img {
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    display: block;
    border: 1px solid #afc3d8;
}

.essay-photo-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.essay-photo-title {
    margin: 0;
    padding: 6px 8px 0;
    font-size: 0.92rem;
    line-height: 1.3;
    color: #000;
}

.essay-references a {
    word-break: break-all;
}

.guard-build-panel {
    margin-top: 20px;
    padding: 18px;
    background: #ffffff;
    border: 1px solid #cad6e3;
    box-shadow: 0 12px 32px rgba(18, 34, 56, 0.08);
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(240px, 1fr);
    gap: 18px;
    align-items: stretch;
}

.guard-build-panel + .guard-build-panel {
    grid-template-columns: minmax(240px, 1fr) minmax(0, 1.7fr);
}

.guard-build-frame {
    background: linear-gradient(145deg, #edf2f7 0%, #dce6f2 100%);
    border: 1px solid #c8d6e5;
    padding: 10px;
}

.guard-build-photo {
    display: block;
}

.guard-build-photo img {
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    display: block;
    border: 1px solid #adc2d8;
}

.guard-build-note {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    padding: 14px;
    background: #f6f9fc;
    border: 1px solid #d8e2ed;
}

.guard-build-note h2 {
    margin: 0;
    font-size: 1.6rem;
    color: #000;
    line-height: 1.1;
}

.guard-build-note p {
    margin: 0;
    color: #000;
    line-height: 1.7;
}

body.lightbox-open {
    overflow: hidden;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: rgba(0, 0, 0, 0.78);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.lightbox.is-open {
    display: flex;
}

.lightbox-inner {
    position: relative;
    width: min(1200px, 96vw);
    max-height: 92vh;
}

.lightbox-image {
    width: 100%;
    max-height: 92vh;
    object-fit: contain;
    display: block;
    background: #111;
}

.lightbox-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
}

.contact-form {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    font-weight: 700;
    display: block;
    margin-bottom: 6px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 11px 12px;
    border-radius: 12px;
    border: 1px solid var(--line);
    font: inherit;
    background: rgba(255, 255, 255, 0.95);
}

.field-error {
    color: var(--danger);
    min-height: 1.4em;
    font-size: 0.9rem;
}

.form-feedback {
    min-height: 1.4em;
    margin-top: 10px;
    font-weight: 700;
}

.form-feedback.is-success {
    color: var(--ok);
}

.submit-btn {
    width: 100%;
    border: 0;
    border-radius: 999px;
    padding: 11px 16px;
    background: var(--brand);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1);
}

.submit-btn:hover {
    background: var(--brand-deep);
}

.contact-info {
    margin-top: 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.info-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.last-updated {
    margin-top: 14px;
    color: var(--ink-soft);
    font-size: 0.95rem;
}

footer {
    border-top: 1px solid var(--line);
    background: var(--surface-alt);
    color: var(--ink);
    padding: 80px 18px 40px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto 40px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
}

.footer-section h3 {
    font-size: 1.1rem;
    margin-bottom: 16px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 12px;
}

.footer-section a {
    color: var(--ink);
    text-decoration: none;
    transition: color var(--transition);
}

.footer-section a:hover {
    color: var(--brand);
}

.copyright {
    text-align: center;
    color: var(--ink-soft);
    font-size: 0.9rem;
    padding-top: 24px;
    border-top: 1px solid var(--line);
    max-width: 1200px;
    margin: 0 auto;
}

.social-links {
    margin-top: 8px;
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.social-links a {
    color: var(--ink);
    text-decoration: none;
    transition: color var(--transition);
}

#preloader {
    display: flex;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100vh;
    z-index: 99999;
}

#preloader:before,
#preloader:after {
    content: "";
    background: var(--brand);
    position: absolute;
    inset: 0;
    width: 50%;
    height: 100%;
    transition: all 0.3s ease 0s;
    z-index: -1;
}

#preloader:after {
    left: auto;
    right: 0;
}

#preloader .line {
    position: relative;
    overflow: hidden;
    margin: auto;
    width: 1px;
    height: 280px;
    transition: all 0.8s ease 0s;
}

#preloader .line:before {
    content: "";
    position: absolute;
    background-color: #fff;
    left: 0;
    top: 50%;
    width: 1px;
    height: 0%;
    transform: translateY(-50%);
    animation: lineincrease 1000ms ease-in-out 0s forwards;
}

#preloader .line:after {
    content: "";
    position: absolute;
    background-color: rgba(250, 250, 248, 0.05);
    left: 0;
    top: 0;
    width: 1px;
    height: 100%;
    transform: translateY(-100%);
    animation: linemove 1200ms linear 0s infinite;
    animation-delay: 2000ms;
}

#preloader.loaded .line {
    opacity: 0;
    height: 100% !important;
}

#preloader.loaded .line:after {
    opacity: 0;
}

#preloader.loaded:before,
#preloader.loaded:after {
    animation: preloaderfinish 300ms ease-in-out 500ms forwards;
}

@keyframes lineincrease {
    0% {
        height: 0%;
    }

    100% {
        height: 100%;
    }
}

@keyframes linemove {
    0% {
        transform: translateY(200%);
    }

    100% {
        transform: translateY(-100%);
    }
}

@keyframes preloaderfinish {
    0% {
        width: 50%;
    }

    100% {
        width: 0%;
    }
}

.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Do not hide the entire CV layout while waiting for reveal observer updates. */
.cv-layout.reveal,
.cv-layout.reveal.is-visible {
    opacity: 1;
    transform: none;
}

.reveal-delay-0 {
    transition-delay: 0ms;
}

.reveal-delay-1 {
    transition-delay: 120ms;
}

.reveal-delay-2 {
    transition-delay: 240ms;
}

.reveal-delay-3 {
    transition-delay: 360ms;
}

.featured-grid .featured-card.reveal:nth-child(1) {
    transition-delay: 80ms;
}

.featured-grid .featured-card.reveal:nth-child(2) {
    transition-delay: 200ms;
}

.featured-grid .featured-card.reveal:nth-child(3) {
    transition-delay: 320ms;
}

body.a11y-mode {
    background: #fff;
    color: #000;
}

body.a11y-mode,
body.a11y-mode h1,
body.a11y-mode h2,
body.a11y-mode h3,
body.a11y-mode h4,
body.a11y-mode h5,
body.a11y-mode h6,
body.a11y-mode button,
body.a11y-mode input,
body.a11y-mode select,
body.a11y-mode textarea {
    font-family: "Noto Sans", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
}

body.a11y-mode .card,
body.a11y-mode .cv-sidebar,
body.a11y-mode .contact-form,
body.a11y-mode .contact-info,
body.a11y-mode .hero-content,
body.a11y-mode .navbar {
    box-shadow: none;
    border: 2px solid #000;
    background: #fff;
    color: #000;
}

body.a11y-mode a,
body.a11y-mode .logo,
body.a11y-mode .menu a,
body.a11y-mode .social-links a {
    color: #000;
}

body.a11y-mode .download-button,
body.a11y-mode .download-button:hover,
body.a11y-mode .download-button:visited {
    color: #fff;
}

body.a11y-mode .cta-white-on-a11y,
body.a11y-mode .cta-white-on-a11y:hover,
body.a11y-mode .cta-white-on-a11y:visited {
    color: #fff;
}

.resume-download {
    margin: 16px 0;
    padding: 16px;
    background: var(--surface-alt);
    border: 2px solid var(--brand);
    border-radius: var(--radius);
    text-align: center;
}

.download-button {
    display: inline-block;
    padding: 12px 24px;
    background: var(--brand);
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 999px;
    transition: background var(--transition), transform var(--transition);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1);
}

.download-button:hover {
    background: var(--brand-deep);
    transform: translateY(-2px);
}

.download-button:focus-visible {
    outline: 3px solid var(--brand);
    outline-offset: 2px;
}

@media (max-width: 920px) {
    .cv-layout {
        grid-template-columns: 1fr;
    }

    .two-col {
        grid-template-columns: 1fr;
    }

    .featured-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .guard-build-panel,
    .guard-build-panel + .guard-build-panel {
        grid-template-columns: 1fr;
    }

    .essay-content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .navbar-container {
        flex-direction: row;
        align-items: center;
        flex-wrap: nowrap;
        gap: 8px;
        padding: 8px 10px;
    }

    .logo {
        font-size: 0.95rem;
        white-space: nowrap;
    }

    .menu {
        flex: 1;
        min-width: 0;
        justify-content: flex-start;
        flex-direction: row;
        align-items: center;
        flex-wrap: nowrap;
        gap: 12px;
        overflow-x: auto;
        white-space: nowrap;
    }

    .menu > li {
        width: auto;
        display: flex;
        align-items: center;
        flex-wrap: nowrap;
        flex: 0 0 auto;
    }

    .menu a {
        width: auto;
        font-size: 0.86rem;
        padding-bottom: 1px;
    }

    .menu-item-with-dropdown {
        justify-content: flex-start;
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .menu-item-with-dropdown .menu-link {
        flex: 0 0 auto;
    }

    .a11y-toggle {
        font-size: 0.72rem;
        padding: 5px 8px;
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .hero {
        min-height: 50vh;
        padding: 40px 18px;
    }

    .hero-content h1 {
        font-size: clamp(1.8rem, 5vw, 2.8rem);
    }

    .hero-content p {
        font-size: 1rem;
    }

    .hero-actions {
        gap: 12px;
    }

    .cta-button {
        padding: 10px 24px;
        font-size: 0.85rem;
    }

    .dropdown-menu {
        position: static;
        width: 100%;
        min-width: 0;
        margin: 6px 0 0;
        box-shadow: none;
        transform: none;
        display: none;
        opacity: 1;
        visibility: visible;
        flex-basis: 100%;
        white-space: normal;
    }

    .menu-item-with-dropdown.open .dropdown-menu,
    .menu-item-with-dropdown:hover .dropdown-menu {
        display: block;
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    .dropdown-toggle {
        margin-left: 4px;
        font-size: 0.62rem;
    }

    .featured {
        padding: 60px 18px;
    }

    .featured h2 {
        margin-bottom: 40px;
    }

    .featured-grid {
        gap: 24px;
    }

    .cta-section {
        padding: 60px 18px;
    }

    .section {
        padding: 60px 18px;
    }

    .card-grid {
        gap: 24px;
    }

    .card {
        padding: 20px;
    }

    footer {
        padding: 60px 18px 30px;
    }

    .reveal,
    .featured-grid .featured-card.reveal:nth-child(1),
    .featured-grid .featured-card.reveal:nth-child(2),
    .featured-grid .featured-card.reveal:nth-child(3) {
        transition-delay: 0ms;
    }

    .guard-build-hero {
        padding: 18px 18px 20px;
    }

    .guard-build-hero h1 {
        gap: 10px;
    }

    .guard-build-panel {
        padding: 14px;
    }

    .guard-build-note {
        padding: 12px;
    }

    .essay-slide {
        padding: 14px;
    }

    .essay-images-2,
    .essay-images-4 {
        grid-template-columns: 1fr;
    }

    .guard-bg-stage::after {
        background:
            linear-gradient(120deg, rgba(18, 18, 18, 0.74) 0%, rgba(42, 42, 42, 0.62) 45%, rgba(16, 16, 16, 0.8) 100%),
            radial-gradient(circle at 20% 10%, rgba(180, 180, 180, 0.16), transparent 46%);
    }
}

@media (max-width: 480px) {
    .navbar-container {
        padding: 8px;
    }

    .logo {
        font-size: 0.9rem;
    }

    .menu {
        gap: 8px;
        font-size: 0.84rem;
    }

    .menu a {
        padding-bottom: 1px;
    }

    .a11y-toggle {
        font-size: 0.68rem;
        padding: 4px 6px;
    }

    .hero {
        min-height: 45vh;
        padding: 30px 12px;
    }

    .hero-content h1 {
        font-size: clamp(1.4rem, 4vw, 2rem);
        margin-bottom: 12px;
    }

    .hero-content p {
        font-size: 0.95rem;
        margin-bottom: 20px;
    }

    .hero-actions {
        flex-direction: column;
        gap: 10px;
    }

    .cta-button {
        width: 100%;
        padding: 12px 16px;
        text-align: center;
    }

    .featured {
        padding: 40px 12px;
    }

    .featured h2 {
        font-size: clamp(1.5rem, 3vw, 2rem);
        margin-bottom: 30px;
    }

    .featured-grid {
        gap: 16px;
    }

    .featured-card {
        aspect-ratio: 3 / 4;
    }

    .cta-section {
        padding: 40px 12px;
    }

    .cta-section h2 {
        font-size: clamp(1.3rem, 3vw, 1.8rem);
        margin-bottom: 12px;
    }

    .cta-section p {
        font-size: 0.95rem;
        margin-bottom: 20px;
    }

    .section {
        padding: 40px 12px;
    }

    .section h2 {
        font-size: clamp(1.3rem, 3vw, 1.8rem);
    }

    .card-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .card {
        padding: 16px;
    }

    .footer-content {
        gap: 16px;
    }

    footer {
        padding: 40px 12px 20px;
    }

    .copyright {
        font-size: 0.85rem;
    }
}

@media (orientation: portrait) {
    .menu {
        overflow: visible !important;
    }

    .menu-item-with-dropdown .menu-link,
    .menu-item-with-dropdown .dropdown-toggle {
        display: inline-flex !important;
        align-items: center;
        position: relative;
        z-index: 2;
    }

    .menu-item-with-dropdown .dropdown-toggle {
        margin-left: 6px !important;
        margin-top: 0 !important;
        align-self: auto;
    }

    .cv-layout {
        grid-template-columns: 1fr;
    }

    .menu-item-with-dropdown {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        position: relative !important;
    }

    .menu-item-with-dropdown .dropdown-menu {
        position: absolute !important;
        top: calc(100% + 8px) !important;
        left: 0 !important;
        right: auto !important;
        width: max-content;
        min-width: 140px;
        margin: 0 !important;
        transform: translateY(-8px) !important;
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1) !important;
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
        flex: 0 0 auto !important;
        white-space: nowrap !important;
        z-index: 120 !important;
    }

    .menu-item-with-dropdown.open .dropdown-menu,
    .menu-item-with-dropdown:hover .dropdown-menu,
    .menu-item-with-dropdown:focus-within .dropdown-menu {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: translateY(0) !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .reveal,
    .reveal.is-visible,
    .cta-button,
    .submit-btn {
        transition: none;
        transition-delay: 0ms;
        transform: none;
    }

    .guard-bg-layer {
        transition: none;
        transform: none;
    }
}
