/* ============================================================
   Beautiful Hugo — Portfolio Adaptation
   Accent:  #0085a1  (teal)
   Nav bg:  #F5F5F5
   Body:    #404040 on #FFF
   ============================================================ */

:root {
  --teal:        #0085a1;
  --teal-light:  #00a8cc;
  --teal-dim:    rgba(0, 133, 161, 0.1);
  --teal-border: rgba(0, 133, 161, 0.3);
  --link:        #008AFF;
  --bg:          #ffffff;
  --bg-nav:      #F5F5F5;
  --bg-alt:      #f8f8f8;
  --bg-card:     #ffffff;
  --text:        #404040;
  --text-light:  #808080;
  --text-xlight: #aaaaaa;
  --border:      #EAEAEA;
  --border2:     #dddddd;
  --nav-h:       51px;           /* Beautiful Hugo navbar height */
  --font:        'Open Sans', 'Noto Sans TC', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-mono:   'IBM Plex Mono', 'Courier New', monospace;
  --ease:        cubic-bezier(0.4, 0, 0.2, 1);
  --dur:         0.2s;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 18px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: var(--link);
  text-decoration: none;
  transition: color var(--dur);
}
a:hover, a:focus { color: var(--teal); }

ul { list-style: none; }

strong { font-weight: 700; color: var(--text); }

/* Beautiful Hugo selection */
::selection       { color: #fff; background: var(--teal); text-shadow: none; }
::-moz-selection  { color: #fff; background: var(--teal); text-shadow: none; }

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

/* Scrollbar */
::-webkit-scrollbar       { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg-nav); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--teal); }

/* ============================================================
   UTILITY
   ============================================================ */
.mono { font-family: var(--font-mono); }
.c-teal { color: var(--teal); }

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 15px;
}

/* Beautiful Hugo's signature short horizontal rule */
.hr-small {
  max-width: 100px;
  margin: 15px auto 30px;
  border: none;
  border-top: 4px solid var(--teal);
  border-radius: 3px;
}
.hr-small.left { margin-left: 0; }

/* ============================================================
   CANVAS BACKGROUND  (very subtle)
   ============================================================ */
#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.3;
}

/* ============================================================
   PROGRESS BAR
   ============================================================ */
#progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--teal);
  z-index: 1000;
  transition: width 0.12s linear;
}

/* ============================================================
   NAVIGATION  — Beautiful Hugo style
   ============================================================ */
#nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  background: var(--bg-nav);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  /* Beautiful Hugo navbar transition */
  transition: padding 0.5s ease-in-out;
}

.nav-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 15px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Brand */
.nav-brand {
  font-family: var(--font);
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.02em;
  transition: color var(--dur);
}
.nav-brand:hover { color: var(--teal); }

/* Links — Beautiful Hugo: UPPERCASE, 12px, letter-spacing 1px, fw 800 */
.nav-links {
  display: flex;
  align-items: center;
  gap: 0;
}

.nav-links a {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0 15px;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  transition: color var(--dur), background var(--dur);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--teal);
  background: rgba(0, 133, 161, 0.06);
}

/* Language Toggle */
.lang-toggle {
  font-family: var(--font);
  font-size: 11px;
  font-weight: 800;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0 10px;
  height: 28px;
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: 2px;
  cursor: pointer;
  margin-right: 8px;
  transition: color var(--dur), border-color var(--dur), background var(--dur);
  white-space: nowrap;
}
.lang-toggle:hover {
  color: var(--teal);
  border-color: var(--teal);
  background: var(--teal-dim);
}

/* Hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: all 0.3s var(--ease);
  transform-origin: center;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav */
.mobile-nav {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  background: var(--bg-nav);
  border-bottom: 1px solid var(--border);
  z-index: 99;
  padding: 10px 0;
  transform: translateY(-8px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s var(--ease), opacity 0.25s var(--ease);
}
.mobile-nav.open { transform: translateY(0); opacity: 1; pointer-events: all; }
.mobile-nav ul { display: flex; flex-direction: column; }
.mobile-nav a {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 12px 20px;
  display: block;
  transition: color var(--dur);
}
.mobile-nav a:hover { color: var(--teal); }

/* ============================================================
   HERO SECTION — Beautiful Hugo "intro-header" style
   ============================================================ */
#hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  padding: calc(var(--nav-h) + 60px) 15px 60px;
  text-align: center;
  /* Beautiful Hugo big-img feel without an image */
  background: linear-gradient(135deg, #f8fcfd 0%, #eef7fa 50%, #f0f8fb 100%);
  border-bottom: 1px solid var(--border);
}

.hero-inner {
  position: relative;
  max-width: 800px;
  width: 100%;
}

/* Beautiful Hugo: page-heading style */
.hero-eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--text-light);
  text-transform: uppercase;
  margin-bottom: 20px;
}

.hero-name {
  font-family: var(--font);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 0;
}

.name-zh {
  display: block;
  font-size: clamp(3rem, 10vw, 6rem);
  color: var(--text);
  letter-spacing: 0.12em;
}

.name-en {
  display: block;
  font-size: clamp(1rem, 3vw, 1.6rem);
  color: var(--text-light);
  font-weight: 400;
  letter-spacing: 0.06em;
  margin-top: 8px;
}

/* The signature hr.small in teal */
.hero-divider {
  max-width: 100px;
  margin: 20px auto;
  border: none;
  border-top: 4px solid var(--teal);
  border-radius: 3px;
}

.hero-sub {
  font-family: var(--font-mono);
  font-size: clamp(0.85rem, 2vw, 1rem);
  color: var(--text-light);
  letter-spacing: 0.04em;
  margin-bottom: 30px;
  height: 1.5em;
}

.cursor {
  display: inline-block;
  color: var(--teal);
  animation: blink 1.1s step-end infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* Contact links */
.hero-contacts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
  margin-bottom: 40px;
}
.hc-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-light);
  transition: color var(--dur);
}
.hc-link svg { width: 14px; height: 14px; flex-shrink: 0; }
.hc-link:hover { color: var(--teal); }

/* Scroll indicator */
.scroll-indicator {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-xlight);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: color var(--dur);
}
.scroll-indicator:hover { color: var(--teal); }
.scroll-chevron { animation: bounce 2s ease infinite; }
.scroll-chevron svg { width: 20px; height: 20px; }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(6px); } }

/* ============================================================
   HERO PAGE-LOAD ANIMATIONS
   ============================================================ */
.anim-fade {
  opacity: 0;
  transform: translateY(15px);
  animation: fadeUp 0.8s var(--ease) forwards;
  animation-delay: var(--d, 0s);
}
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }

/* ============================================================
   SECTIONS — Beautiful Hugo content style
   ============================================================ */
.sec {
  position: relative;
  z-index: 1;
  padding: 70px 0;
  background: var(--bg);
}
.sec-alt { background: var(--bg-alt); }

/* Section header — matches Beautiful Hugo page-heading with hr */
.sec-head {
  text-align: center;
  margin-bottom: 50px;
}

.sec-head h2 {
  font-family: var(--font);
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 0;
}

/* ============================================================
   ABOUT
   ============================================================ */
.about-wrap {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 60px;
  align-items: start;
}

.about-text p {
  font-size: 1rem;
  color: var(--text);
  line-height: 1.75;
  margin-bottom: 18px;
}
.about-text p:last-child { margin-bottom: 0; }

.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stat {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 18px 12px;
  text-align: center;
  border-radius: 0;
  transition: border-color var(--dur), box-shadow var(--dur);
}
.stat:hover {
  border-color: var(--teal);
  box-shadow: 0 2px 12px rgba(0, 133, 161, 0.1);
}

.stat-n {
  font-family: var(--font);
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--teal);
  line-height: 1;
  margin-bottom: 6px;
}
.stat-l {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-light);
  text-transform: uppercase;
  line-height: 1.3;
}

/* ============================================================
   TIMELINE — Beautiful Hugo blog-list style
   ============================================================ */
.timeline {
  position: relative;
  padding-left: 30px;
  max-width: 800px;
  margin: 0 auto;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--border);
}

.tl-item {
  position: relative;
  margin-bottom: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
}
.tl-item:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }

.tl-dot {
  position: absolute;
  left: -26px;
  top: 5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--teal);
  border: 2px solid var(--bg-alt);
}

.tl-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

/* Beautiful Hugo blog-tags style */
.tl-badge {
  font-family: var(--font);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 2px;
}
.badge-work {
  background: var(--teal-dim);
  color: var(--teal);
  border: 1px solid var(--teal-border);
}
.badge-edu {
  background: rgba(0, 100, 50, 0.07);
  color: #006432;
  border: 1px solid rgba(0, 100, 50, 0.25);
}

.tl-date {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-light);
  font-style: italic;
}

.tl-title {
  font-family: var(--font);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 4px;
}
.tl-org {
  font-size: 0.9rem;
  color: var(--text-light);
  font-style: italic;
  margin-bottom: 14px;
}

.tl-list { display: flex; flex-direction: column; gap: 6px; }
.tl-list li {
  position: relative;
  padding-left: 20px;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.65;
}
.tl-list li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--teal);
}

/* ============================================================
   PROJECTS — Beautiful Hugo post-preview style
   ============================================================ */
.proj-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.proj-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 30px;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.25s, border-color 0.25s;
  margin: 0; /* collapse borders like Beautiful Hugo */
}
.proj-card:hover {
  box-shadow: 0 2px 20px rgba(0, 133, 161, 0.1);
  border-color: var(--teal);
  z-index: 1;
  position: relative;
}

.proj-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}
.proj-date {
  font-size: 13px;
  font-style: italic;
  color: var(--text-light);
}
.proj-ext { color: var(--text-xlight); transition: color var(--dur); }
.proj-ext:hover { color: var(--teal); }
.proj-ext svg { width: 15px; height: 15px; }

.proj-title {
  font-family: var(--font);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 10px;
}

.proj-desc {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.7;
  flex: 1;
  margin-bottom: 18px;
}

/* Beautiful Hugo blog-tags style for tech tags */
.proj-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}
.proj-tags span {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  color: var(--link);
  padding: 0 5px;
  transition: background var(--dur), color var(--dur);
}
.proj-tags span::before { content: '#'; }
.proj-tags span:hover {
  background: var(--border);
  border-radius: 2px;
  color: var(--teal);
}

/* ============================================================
   SKILLS
   ============================================================ */
.skills-wrap {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px 80px;
  max-width: 900px;
  margin: 0 auto;
}

.skill-cat h3 {
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--teal);
}

.sk-tags { display: flex; flex-wrap: wrap; gap: 6px; }

.sk-tags span {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  padding: 5px 12px;
  background: var(--bg);
  border: 1px solid var(--border2);
  color: var(--text);
  transition: all var(--dur);
  cursor: default;
}
.sk-tags span:hover {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

.sk-tags.cert span { border-color: var(--teal-border); color: var(--teal); }
.sk-tags.cert span:hover { background: var(--teal); color: #fff; }

.sk-tags.lang span { border-color: var(--teal-border); color: var(--teal); }
.sk-tags.lang span:hover { background: var(--teal); color: #fff; }

/* ============================================================
   CONTACT
   ============================================================ */
.contact-wrap {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}
.contact-intro {
  font-size: 1rem;
  color: var(--text);
  line-height: 1.8;
  margin-bottom: 30px;
}

/* Beautiful Hugo pager/button style */
.contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 30px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border2);
  border-radius: 0;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: background var(--dur), color var(--dur), border-color var(--dur);
  margin-bottom: 40px;
}
.contact-btn:hover {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}
.contact-btn svg { width: 14px; height: 14px; }

.contact-socials {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.social-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-light);
  transition: color var(--dur);
}
.social-link svg { width: 16px; height: 16px; flex-shrink: 0; }
.social-link:hover { color: var(--teal); }

/* ============================================================
   FOOTER — Beautiful Hugo style
   ============================================================ */
.footer {
  position: relative;
  z-index: 1;
  background: var(--bg-nav);
  border-top: 1px solid var(--border);
  padding: 30px 0;
  text-align: center;
}

.footer p {
  font-family: var(--font);
  font-size: 14px;
  color: var(--text-light);
}
.footer-sub { margin-top: 6px; font-size: 12px; }
.footer a { color: var(--text-light); }
.footer a:hover { color: var(--teal); }

/* ============================================================
   SCROLL REVEAL
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 820px) {
  .about-wrap { grid-template-columns: 1fr; gap: 40px; }
  .about-stats { order: -1; }
  .proj-grid { grid-template-columns: 1fr; }
  .skills-wrap { grid-template-columns: 1fr; gap: 30px; }
}

@media (max-width: 768px) {
  .nav-links     { display: none; }
  .nav-hamburger { display: flex; }
  .mobile-nav    { display: block; }
}

@media (max-width: 480px) {
  .container { padding: 0 15px; }
  .sec { padding: 50px 0; }
  .timeline { padding-left: 20px; }
  .contact-btn { width: 100%; justify-content: center; }
  .hero-contacts { flex-direction: column; align-items: center; }
}
