/* ==========================================================================
   栩澐｜全端工程師履歷網站 — 核心樣式 (assets/main.css)
   無外部字型 / CDN 依賴；版面採 CSS Grid + Flex，行動優先。
   ========================================================================== */

:root {
  --ink: #111111;
  --ink-2: #333333;
  --muted: #666666;
  --line: #e5e5e5;
  --bg: #ffffff;
  --surface: #ffffff;
  --primary: #dc2626;
  --primary-600: #b91c1c;
  --primary-100: #fee2e2;
  --accent: #000000;
  --dark: #000000;
  --dark-2: #1a1a1a;
  --ok: #059669;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 14px 30px -20px rgba(0, 0, 0, .3);
  --maxw: 1140px;
  --font: "Inter", "Noto Sans TC", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang TC", "Microsoft JhengHei", "Helvetica Neue", Arial, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  overflow-x: hidden;
}

img, svg { max-width: 100%; height: auto; }

h1, h2, h3, h4 { margin: 0 0 .6em; line-height: 1.35; font-weight: 700; color: var(--ink); }
h1 { font-size: clamp(1.7rem, 4.4vw, 2.9rem); }
h2 { font-size: clamp(1.35rem, 3vw, 2.05rem); }
h3 { font-size: clamp(1.05rem, 1.6vw, 1.28rem); }

p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

.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;
}

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--dark); color: #fff; padding: 10px 16px; border-radius: 0 0 10px 10px;
  transition: top .2s ease;
}
.skip-link:focus { top: 0; }

.muted { color: var(--muted); }
.center { text-align: center; }

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

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 70px;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 40px;
  border-radius: 12px; background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; font-weight: 700; font-size: .95rem; letter-spacing: .04em;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 1.05rem; }
.brand-text small { color: var(--muted); font-size: .76rem; letter-spacing: .02em; }

.nav-toggle {
  display: none; width: 44px; height: 44px; padding: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  cursor: pointer;
}
.nav-toggle-bar {
  display: block; height: 2px; width: 100%; margin: 4px 0;
  background: var(--ink); border-radius: 2px; transition: transform .25s ease, opacity .25s ease;
}
body.nav-open .nav-toggle-bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
body.nav-open .nav-toggle-bar:nth-child(2) { opacity: 0; }
body.nav-open .nav-toggle-bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.site-nav ul { display: flex; align-items: center; gap: 4px; }
.site-nav a {
  display: block; padding: 9px 14px; border-radius: 999px;
  color: var(--ink-2); font-size: .95rem; font-weight: 500;
}
.site-nav a:hover { background: #eef2f9; color: var(--primary); text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--primary); background: var(--primary-100); font-weight: 600; }
.site-nav .nav-cta {
  background: var(--dark); color: #fff; font-weight: 600; padding: 10px 18px;
}
.site-nav .nav-cta:hover { background: var(--primary); color: #fff; }
.site-nav .nav-cta[aria-current="page"] { background: var(--primary); color: #fff; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; border: 1px solid transparent;
  font-family: inherit; font-size: .96rem; font-weight: 600; line-height: 1.4;
  cursor: pointer; text-align: center; transition: transform .18s ease, background .18s ease, color .18s ease, border-color .18s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-600); color: #fff; }
.btn-dark { background: var(--dark); color: #fff; }
.btn-dark:hover { background: var(--primary); color: #fff; }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-outline { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .55); }
.btn-outline:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.btn-block { width: 100%; }

/* ---------- Section scaffolding ---------- */
.section { padding: 84px 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-tight { padding: 40px 0 0; }
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; flex-wrap: wrap; margin-bottom: 34px;
}
.section-title { margin-bottom: .35em; }
.section-sub { color: var(--muted); max-width: 62ch; margin-bottom: 0; }
.section-head .section-sub { margin-bottom: 0; }
.eyebrow {
  margin: 0 0 .6em; font-size: .78rem; font-weight: 700; letter-spacing: .16em;
  text-transform: uppercase; color: var(--primary);
}

/* ---------- Hero ---------- */
.hero {
  padding: 72px 0 56px;
  background:
    radial-gradient(1000px 420px at 88% -8%, rgba(14, 165, 233, .16), transparent 65%),
    radial-gradient(760px 380px at 4% 6%, rgba(29, 78, 216, .12), transparent 60%),
    var(--bg);
}
.hero-inner {
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 44px; align-items: start;
}
.hero h1 { margin-bottom: 20px; }
.hl {
  background: linear-gradient(transparent 62%, rgba(14, 165, 233, .35) 62%);
  padding: 0 .08em;
}
.lead { font-size: 1.05rem; color: var(--ink-2); max-width: 62ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 22px; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.hero-tags li {
  padding: 6px 12px; border-radius: 999px; font-size: .82rem; font-weight: 600;
  color: var(--ink-2); background: var(--surface); border: 1px solid var(--line);
}
.hero-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow);
}
.hero-card-title {
  margin: 0 0 16px; font-size: .78rem; font-weight: 700; letter-spacing: .16em;
  text-transform: uppercase; color: var(--muted);
}
.fact-list { margin: 0 0 20px; display: grid; gap: 12px; }
.fact-list > div {
  display: flex; justify-content: space-between; gap: 14px;
  padding-bottom: 12px; border-bottom: 1px dashed var(--line);
}
.fact-list > div:last-child { border-bottom: 0; padding-bottom: 0; }
.fact-list dt { color: var(--muted); font-size: .86rem; flex: 0 0 auto; }
.fact-list dd { margin: 0; font-size: .9rem; font-weight: 600; text-align: right; color: var(--ink); }

/* ---------- Stats ---------- */
.stat-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 8px; box-shadow: var(--shadow);
}
.stat { padding: 22px 18px; border-radius: var(--radius-sm); text-align: center; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat strong { display: block; font-size: clamp(1.5rem, 3vw, 2rem); color: var(--primary); line-height: 1.2; }
.stat span { font-size: .86rem; color: var(--muted); }

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

.card, .skill-group, .panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow);
}
.section-alt .card, .section-alt .skill-group, .section-alt .panel { background: var(--bg); }
.card h3 { margin-bottom: .5em; }
.card p:last-child { margin-bottom: 0; }
.card-icon {
  display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 12px;
  margin-bottom: 16px; border-radius: 12px; background: var(--primary-100); color: var(--primary);
  font-size: .8rem; font-weight: 700; letter-spacing: .06em;
}

/* ---------- Footer ---------- */
.site-footer { background: var(--dark); color: #cbd5e1; padding: 64px 0 26px; margin-top: 0; }
.footer-grid {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: 32px;
  padding-bottom: 30px; border-bottom: 1px solid rgba(255, 255, 255, .1);
}
.footer-logo { margin: 0 0 12px; color: #fff; font-size: 1.15rem; font-weight: 700; }
.footer-logo span { display: block; font-size: .78rem; font-weight: 500; color: #94a3b8; letter-spacing: .08em; }
.footer-desc { color: #94a3b8; font-size: .9rem; margin-bottom: 0; }
.footer-col h3 {
  margin: 0 0 14px; color: #fff; font-size: .82rem; letter-spacing: .14em; text-transform: uppercase;
}
.footer-col ul { display: grid; gap: 9px; }
.footer-col a, .footer-col li { color: #94a3b8; font-size: .9rem; }
.footer-col a:hover { color: #fff; text-decoration: none; }
.footer-bottom {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; padding-top: 22px; font-size: .82rem; color: #64748b;
}
.footer-bottom p { margin: 0; }
.footer-note { color: #64748b; }

/* ---------- Page hero (inner pages) ---------- */
.page-hero {
  padding: 56px 0 48px;
  background:
    radial-gradient(900px 340px at 92% -20%, rgba(29, 78, 216, .16), transparent 62%),
    var(--surface);
  border-bottom: 1px solid var(--line);
}
.breadcrumb { margin-bottom: 22px; font-size: .84rem; }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.breadcrumb li + li::before { content: "/"; margin-right: 8px; color: var(--muted); }
.breadcrumb li[aria-current] { color: var(--muted); }
.page-hero h1 { max-width: 46ch; }
.page-hero .lead { margin-bottom: 0; }

/* ---------- CTA band ---------- */
.cta-band {
  background: linear-gradient(135deg, var(--dark) 0%, var(--primary) 130%);
  color: #e2e8f0; padding: 60px 0;
}
.cta-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 30px; flex-wrap: wrap;
}
.cta-inner h2 { color: #fff; margin-bottom: .35em; max-width: 40ch; }
.cta-inner p { color: #cbd5e1; margin-bottom: 0; max-width: 60ch; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.cta-actions .btn-primary { background: #fff; color: var(--primary); }
.cta-actions .btn-primary:hover { background: #e2e8f0; color: var(--dark); }

/* ---------- Layout helpers ---------- */
.two-col { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 36px; align-items: start; }
.two-col-wide { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
.prose p { color: var(--ink-2); }
.panel-title {
  margin: 0 0 16px; font-size: .82rem; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted);
}
.panel .panel-title + .panel-title, .panel ul + .panel-title { margin-top: 26px; }
.bullet-list { display: grid; gap: 10px; }
.bullet-list li { position: relative; padding-left: 20px; color: var(--ink-2); font-size: .94rem; }
.bullet-list li::before {
  content: ""; position: absolute; left: 2px; top: .68em;
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
}
.bullet-list-sm li { font-size: .88rem; }

/* ---------- Reveal animation (JS 增強；無 JS 時仍可見) ---------- */
html.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
html.js .reveal.is-visible { opacity: 1; transform: none; }
html.js .reveal.is-done { transition: none; }

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

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .card-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .section { padding: 64px 0; }
  .nav-toggle { display: block; }
  .site-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--surface); border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 30px -22px rgba(15, 23, 42, .45);
    padding: 12px 16px 20px; display: none;
  }
  body.nav-open .site-nav { display: block; }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: 4px; }
  .site-nav a { padding: 13px 14px; border-radius: 12px; }
  .site-nav .nav-cta { text-align: center; margin-top: 8px; }
  .hero-inner, .two-col, .two-col-wide { grid-template-columns: minmax(0, 1fr); }
  .hero { padding: 52px 0 44px; }
  .card-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cta-inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 640px) {
  body { font-size: 15.5px; }
  .container { padding: 0 16px; }
  .section { padding: 52px 0; }
  .brand-text small { display: none; }
  .card-grid-2, .card-grid-3, .card-grid-4, .stat-grid { grid-template-columns: minmax(0, 1fr); }
  .stat + .stat { border-left: 0; border-top: 1px solid var(--line); }
  .card, .skill-group, .panel, .hero-card { padding: 20px; }
  .hero-actions .btn, .cta-actions .btn { width: 100%; }
  .fact-list > div { flex-direction: column; gap: 4px; }
  .fact-list dd { text-align: left; }
  .footer-grid { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .page-hero { padding: 40px 0 34px; }
}

@media print {
  .site-header, .nav-toggle, .cta-band, .skip-link { display: none !important; }
  body { background: #fff; }
  .card, .panel, .hero-card, .project-card { box-shadow: none; }
}

/* awb-table-scroll-safety v1 */
.table-wrap { max-width: 100%; overflow-x: auto; }

/* awb-mobile-nav-style-completer v1 */
.nav-toggle-label{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: .5rem;
  border: 1px solid currentColor;
  border-radius: .375rem;
  background: transparent;
  cursor: pointer;
  line-height: 0;
}
.nav-toggle-label::before{
  content: "";
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 6px 0 currentColor, 0 -6px 0 currentColor;
}
@media (min-width: 768px){
  .nav-toggle-label{ display: none; }
}
/* 2026-09-20-9: scoped nav-list reset + usable link targets (structural only). */
.site-nav__list{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav__list .site-nav__item{ list-style: none; }
.site-nav__list a{
  display: inline-block;
  min-height: 24px;
  padding: 6px 8px;
}
