/* =========================================================
   leeyuankai-site — style.css
   單頁式專業個人網站：深藍主色 × 安全黃點綴
   ========================================================= */

:root {
  --navy-900: #0b2233;
  --navy-800: #12324f;
  --navy-700: #1b4468;
  --navy-100: #e8eef4;
  --ink: #1f2a33;
  --ink-soft: #4d5d6b;
  --amber: #f5b93a;
  --amber-dark: #d99a16;
  --paper: #ffffff;
  --paper-alt: #f4f7fa;
  --line: #dbe3ea;
  --ok: #2e7d4f;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(11, 34, 51, 0.10);
  --maxw: 1080px;
  --font: "Segoe UI", "Microsoft JhengHei", "PingFang TC", "Noto Sans TC",
    "Helvetica Neue", Arial, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--navy-700); text-decoration: none; }
a:hover { text-decoration: underline; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3 { line-height: 1.3; margin: 0 0 0.5em; }
h1 { letter-spacing: 0.02em; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--amber); color: var(--navy-900); padding: 8px 14px;
}
.skip-link:focus { left: 0; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(11, 34, 51, 0.92);
  backdrop-filter: blur(8px);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.topbar-inner { display: flex; align-items: center; gap: 18px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--amber), #ffd97a);
  color: var(--navy-900); font-weight: 800; font-size: 13px; letter-spacing: 0.02em;
}
.brand-name { font-weight: 700; font-size: 17px; }
.brand-name small { display: block; font-size: 11px; font-weight: 400; color: rgba(255,255,255,0.66); line-height: 1.1; letter-spacing: 0.06em; }

.nav { margin-left: auto; }
.nav-list { display: flex; gap: 4px; }
.nav-list a {
  display: inline-block; padding: 6px 11px; border-radius: 8px;
  color: rgba(255, 255, 255, 0.86); font-size: 14.5px;
}
.nav-list a:hover { background: rgba(255,255,255,0.10); text-decoration: none; color: #fff; }
.nav-list a.active { background: var(--amber); color: var(--navy-900); font-weight: 600; }

.topbar-actions { display: flex; align-items: center; gap: 10px; }
.lang-wrap { position: relative; }
.lang-switch {
  font: inherit; font-size: 13.5px; font-weight: 700; color: var(--navy-900);
  background-color: var(--amber); border: 0; border-radius: 999px;
  padding: 7px 30px 7px 14px; cursor: pointer; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%230b2233' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  transition: background-color 0.2s ease;
}
.lang-switch:hover { background-color: #ffd06b; }
.lang-switch option { color: var(--ink); background: #fff; font-weight: 500; }
.menu-toggle {
  display: none; background: transparent; border: 1px solid rgba(255,255,255,0.3);
  border-radius: 8px; width: 40px; height: 36px; cursor: pointer; padding: 8px 7px;
  flex-direction: column; justify-content: space-between;
}
.menu-toggle span { display: block; height: 2px; background: #fff; border-radius: 2px; transition: 0.25s; }
.menu-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- sections ---------- */
.section { padding: 76px 0 84px; }
.section.alt { background: var(--paper-alt); border-block: 1px solid var(--line); }
.section-title {
  font-size: clamp(26px, 3.4vw, 34px);
  color: var(--navy-800);
  position: relative;
  padding-left: 16px;
}
.section-title::before {
  content: ""; position: absolute; left: 0; top: 8px; bottom: 8px;
  width: 6px; border-radius: 6px; background: linear-gradient(var(--amber), var(--amber-dark));
}
.section-sub { color: var(--ink-soft); margin: -0.4em 0 2.2em 16px; max-width: 46em; }

/* ---------- hero ---------- */
.hero { background: radial-gradient(1200px 520px at 85% -10%, #1b4a74 0%, var(--navy-900) 55%); color: #fff; padding: 64px 0 54px; }
.hero-inner { display: grid; grid-template-columns: 250px 1fr; gap: 42px; align-items: center; }
.hero-photo img {
  width: 250px; height: 250px; object-fit: cover; object-position: center 32%;
  border-radius: 50%; border: 5px solid rgba(255,255,255,0.85);
  outline: 3px solid var(--amber); outline-offset: -2px;
  box-shadow: 0 14px 40px rgba(0,0,0,0.35);
}
.hero-greeting { color: var(--amber); font-weight: 600; margin-bottom: 0.1em; }
.hero-name { font-size: clamp(36px, 5.4vw, 56px); margin: 0; }
.hero-name small { display: block; font-size: 0.42em; font-weight: 600; color: rgba(255,255,255,0.75); letter-spacing: 0.14em; margin-top: 2px; }
.hero-role { margin: 14px 0 6px; font-size: 19px; font-weight: 600; color: #ffd97a; }
.hero-tagline { font-size: clamp(19px, 2.6vw, 24px); font-weight: 700; color: #fff; margin: 10px 0 4px; }
.hero-sub { color: rgba(255,255,255,0.8); font-size: 15.5px; margin-bottom: 22px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-block; font: inherit; font-weight: 600; font-size: 15px;
  padding: 11px 22px; border-radius: 999px; cursor: pointer; transition: 0.18s ease;
  text-decoration: none; border: 1px solid transparent;
}
.btn-primary { background: var(--amber); color: var(--navy-900); }
.btn-primary:hover { background: #ffd06b; text-decoration: none; transform: translateY(-1px); }
.btn-ghost { border-color: rgba(255,255,255,0.5); color: #fff; background: transparent; }
.btn-ghost:hover { background: rgba(255,255,255,0.12); text-decoration: none; }
.btn-small { font-size: 13px; padding: 5px 13px; background: var(--navy-800); color: #fff; }
.btn-small:hover { background: var(--navy-700); }

.hero-quote {
  margin: 44px auto 0; max-width: 780px; text-align: center;
  font-style: italic; color: rgba(255,255,255,0.88);
  border-top: 1px solid rgba(255,255,255,0.15); padding-top: 20px;
}
.hero-quote p { margin: 0; font-size: 16px; }

/* ---------- stats ---------- */
.stats { background: var(--navy-800); padding: 26px 0; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.stat { text-align: center; color: #fff; padding: 6px 10px; }
.stat b { display: block; font-size: clamp(22px, 3vw, 30px); color: var(--amber); }
.stat span { font-size: 13.5px; color: rgba(255,255,255,0.82); }

/* ---------- about ---------- */
.about-grid { display: grid; grid-template-columns: 1.7fr 1fr; gap: 44px; align-items: start; }
.about-text p { text-align: justify; }
.about-extra { position: sticky; top: 90px; }
.about-quote {
  margin: 0 0 26px; padding: 16px 18px 16px 22px;
  background: #fff8e6; border-left: 5px solid var(--amber);
  border-radius: 0 var(--radius) var(--radius) 0; color: var(--navy-800);
  font-weight: 600; font-size: 16.5px;
}
.about-quote p { margin: 0; }
.skills-box h3 { font-size: 15px; color: var(--navy-700); text-transform: uppercase; letter-spacing: 0.08em; }
.future-box { margin-bottom: 28px; }
.future-box h3 { color: var(--amber-dark); }
.future-box .chips li { background: #fff8e6; border-color: #f0dfae; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  font-size: 13px; background: var(--navy-100); color: var(--navy-800);
  border: 1px solid #cdd9e4; border-radius: 999px; padding: 4px 12px;
}

/* ---------- timeline ---------- */
.timeline { position: relative; max-width: 860px; }
.timeline::before {
  content: ""; position: absolute; left: 118px; top: 6px; bottom: 6px;
  width: 2px; background: linear-gradient(#cdd9e4, var(--amber), #cdd9e4);
}
.timeline li { position: relative; padding: 0 0 34px 148px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline .t-dot {
  position: absolute; left: 108px; top: 4px; width: 22px; height: 22px;
  border-radius: 50%; background: #fff; border: 5px solid var(--amber);
  box-shadow: 0 0 0 2px #fff;
}
.timeline .t-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 18px; box-shadow: var(--shadow); transition: transform 0.2s ease;
}
.timeline .t-card:hover { transform: translateY(-2px); }
.timeline .t-period { display: inline-block; position: absolute; left: 0; width: 92px; text-align: right; font-weight: 800; color: var(--navy-700); padding-top: 4px; }
.timeline h3 { font-size: 17.5px; color: var(--navy-800); margin: 0 0 2px; }
.timeline .t-org { font-size: 13.5px; font-weight: 600; color: var(--amber-dark); margin-bottom: 6px; }
.timeline p { margin: 0; font-size: 14.5px; color: var(--ink-soft); }

/* ---------- projects ---------- */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.project-grid li {
  background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--navy-700);
  border-radius: var(--radius); padding: 15px 18px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 9px; transition: 0.2s ease;
}
.project-grid li:hover { transform: translateY(-3px); border-left-color: var(--amber); }
.project-grid strong { font-size: 15.5px; color: var(--ink); line-height: 1.45; }
.project-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.project-tag {
  font-size: 12px; font-weight: 700; background: var(--navy-100); color: var(--navy-800);
  border-radius: 999px; padding: 2px 11px;
}
.project-award { font-size: 12px; font-weight: 700; color: var(--ok); background: #e7f4ec; border-radius: 999px; padding: 2px 11px; }

/* ---------- credentials ---------- */
.credential-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 13px; }
.credential-grid li {
  background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 13px 15px;
  display: flex; justify-content: space-between; gap: 12px; align-items: baseline;
}
.credential-grid b { display: block; font-size: 14.5px; color: var(--ink); }
.credential-grid small { display: block; color: var(--ink-soft); font-size: 12.5px; }
.credential-grid .c-year { flex: none; font-size: 12.5px; font-weight: 700; color: var(--navy-700); background: var(--navy-100); border-radius: 999px; padding: 2px 10px; white-space: nowrap; }

/* ---------- education ---------- */
.edu-list { max-width: 860px; }
.edu-list li {
  display: grid; grid-template-columns: 170px 1fr; gap: 18px;
  border-bottom: 1px dashed var(--line); padding: 16px 4px;
}
.edu-list li:last-child { border-bottom: 0; }
.edu-list .e-period { font-weight: 700; color: var(--navy-700); }
.edu-list .e-degree { font-weight: 700; color: var(--ink); }
.edu-list .e-school { color: var(--ink-soft); font-size: 14px; }
.edu-list .e-note { display: block; font-size: 13px; color: var(--amber-dark); }

/* ---------- contact ---------- */
.contact-section { background: linear-gradient(180deg, var(--navy-900), #0c2436); color: #fff; }
.contact-section .section-title { color: #fff; }
.contact-lead { color: rgba(255,255,255,0.85); max-width: 34em; margin: 0 0 26px 16px; }
.contact-list { max-width: 620px; display: flex; flex-direction: column; gap: 12px; }
.contact-list li {
  display: flex; align-items: center; gap: 14px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.14);
  border-radius: 12px; padding: 12px 16px; flex-wrap: wrap;
}
.contact-list a { color: #fff; }
.contact-ico { font-size: 18px; }
.contact-label { word-break: break-all; }

/* ---------- footer ---------- */
.footer { background: #081722; color: rgba(255,255,255,0.6); font-size: 13px; padding: 26px 0; }
.footer-inner { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.footer p { margin: 0; }
.back-top { color: var(--amber); font-weight: 600; }
.back-top:hover { color: #ffd06b; }

.noscript { padding: 20px; text-align: center; color: #a33; }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { transition: none !important; }
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; justify-items: center; gap: 22px; }
  .hero-actions { justify-content: center; }
  .hero-quote { margin-top: 28px; }
  .about-grid { grid-template-columns: 1fr; }
  .about-extra { position: static; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .timeline::before { left: 12px; }
  .timeline li { padding-left: 46px; }
  .timeline .t-period { position: static; display: block; width: auto; text-align: left; margin-bottom: 2px; font-size: 13.5px; }
  .timeline .t-dot { left: 2px; }
}

@media (max-width: 640px) {
  .section { padding: 56px 0 64px; }
  .menu-toggle { display: flex; }
  .nav {
    position: fixed; inset: 60px 0 auto 0; max-height: 0; overflow: hidden;
    background: var(--navy-900); transition: max-height 0.28s ease;
  }
  .nav.open { max-height: 320px; border-bottom: 1px solid rgba(255,255,255,0.1); }
  .nav-list { flex-direction: column; padding: 8px 22px 16px; gap: 2px; }
  .nav-list a { display: block; padding: 10px 8px; border-radius: 8px; }
  .nav-list a:hover { background: rgba(255,255,255,0.08); }
  .hero-photo img { width: 190px; height: 190px; }
  .edu-list li { grid-template-columns: 1fr; gap: 2px; }
  .project-grid { grid-template-columns: 1fr; }
  .credential-grid { grid-template-columns: 1fr; }
}

/* ---------- print ---------- */
@media print {
  .topbar, .footer, .hero-actions, .back-top, .menu-toggle, .lang-switch { display: none !important; }
  body { color: #000; }
  .hero { background: none !important; color: #000; padding: 0 0 18px; }
  .hero-quote { border-top-color: #ccc; }
  .section { padding: 18px 0; break-inside: avoid; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .timeline::before { background: #ccc; }
}
