/* ==========================================================================
   Base Theme Variables (Default Light Mode matching bchiang7 screenshot)
   ========================================================================== */
:root {
  --bg: #ffffff;
  --fg: #374151;
  --heading: #111827;
  --muted: #6b7280;
  --card-bg: #f9fafb;
  --card-hover: #f3f4f6;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --tag-bg: #f3f4f6;
  --tag-fg: #1f2937;
  --tag-border: #e5e7eb;
  --highlight-underline: #2563eb;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

/* Optional Dark Mode (via html.dark toggle) */
html.dark {
  --bg: #0a1120;
  --fg: #cbd5e1;
  --heading: #f8fafc;
  --muted: #8492a6;
  --card-bg: #111c30;
  --card-hover: #16243d;
  --border: #1e2e4a;
  --border-strong: #2d4369;
  --accent: #38bdf8;
  --accent-hover: #7dd3fc;
  --tag-bg: #16243d;
  --tag-fg: #7dd3fc;
  --tag-border: #22375a;
  --highlight-underline: #38bdf8;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.7;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* ==========================================================================
   Top-Right Fixed Theme Switcher (bchiang7.github.io style)
   ========================================================================== */
.theme-switch-wrapper {
  position: fixed;
  top: 24px;
  right: 32px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.theme-icon {
  color: var(--muted);
  display: block;
}

.switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 20px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border-strong);
  transition: 0.2s;
  border-radius: 20px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.2s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--accent);
}

input:checked + .slider:before {
  transform: translateX(18px);
}

/* ==========================================================================
   Full 100vh Splash Screen (bchiang7.github.io initial viewport)
   ========================================================================== */
.site-wrapper {
  width: 100%;
}

.intro-splash {
  height: 100vh;
  min-height: 600px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

.intro-splash__inner {
  display: flex;
  flex-direction: column;
  gap: 36px;
  max-width: 1000px;
}

.intro__hello {
  margin: 0;
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 500;
  color: var(--heading);
  letter-spacing: -0.01em;
}

.intro__tagline {
  margin: 0;
  font-size: clamp(28px, 4vw, 46px);
  font-weight: 400;
  color: var(--fg);
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.intro__tagline .name {
  font-weight: 700;
  color: var(--heading);
}

.intro__contact {
  font-family: var(--font-mono);
  font-size: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  margin-top: 8px;
}

.contact-prompt {
  font-weight: 600;
  color: var(--heading);
}

.highlight-link {
  color: var(--heading);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  text-decoration-color: var(--highlight-underline);
  transition: color 0.15s ease;
}
.highlight-link:hover {
  color: var(--accent);
}

.dot { color: var(--border-strong); }

.scroll-down {
  position: absolute;
  bottom: 32px;
  left: 48px;
  font-family: var(--font-mono);
  font-size: 20px;
  color: var(--muted);
  text-decoration: none;
  animation: bounce 2s infinite;
}
.scroll-down:hover { color: var(--accent); }

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(8px); }
  60% { transform: translateY(4px); }
}

/* ==========================================================================
   Full-Width Content Flow (Appears only on scroll)
   ========================================================================== */
.content-flow {
  max-width: 1200px;
  margin: 0 auto;
  padding: 64px 48px 120px;
}

/* Asymmetric 2-Column Section Layout */
.section {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 48px;
  padding: 80px 0;
  border-top: 1px solid var(--border);
}

.section__title {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  position: sticky;
  top: 48px;
  height: max-content;
}

.section__content {
  min-width: 0;
  max-width: 860px;
}

.section__content p {
  margin: 0 0 20px;
  font-size: 17px;
  line-height: 1.75;
  color: var(--fg);
}

/* ==========================================================================
   Skills Grid (3 Columns)
   ========================================================================== */
.skill-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.skill-col {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
}

.skill-heading {
  margin: 0 0 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.skill-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skill-col li {
  font-size: 14px;
  color: var(--muted);
  position: relative;
  padding-left: 16px;
}
.skill-col li::before {
  content: "▹";
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* ==========================================================================
   Featured Project Cards
   ========================================================================== */
.featured-list {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.featured-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 28px;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.featured-card:hover {
  background: var(--card-hover);
  border-color: var(--border-strong);
}

.featured-header {
  margin-bottom: 12px;
}

.featured-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}

.featured-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  display: inline-block;
}
.featured-title a {
  color: var(--heading);
  text-decoration: none;
}
.featured-title a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.featured-links {
  display: inline-block;
  margin-left: 12px;
  font-family: var(--font-mono);
  font-size: 13px;
}
.featured-links a {
  color: var(--muted);
  text-decoration: none;
}
.featured-links a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.featured-card p {
  margin: 0 0 16px;
  font-size: 16px;
  color: var(--muted);
  line-height: 1.65;
}

.tag-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-list li {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 12px;
  background: var(--tag-bg);
  color: var(--tag-fg);
  border: 1px solid var(--tag-border);
}

/* ==========================================================================
   Experience
   ========================================================================== */
.job-item {
  padding: 12px 0;
}
.job-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}
.job-role {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--heading);
}
.job-date {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
}
.job-desc {
  font-size: 16px;
  color: var(--muted);
  margin: 0;
}
.todo { opacity: 0.5; }

/* ==========================================================================
   Archive Table & Filter Bar
   ========================================================================== */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  font-family: var(--font-mono);
  font-size: 12px;
}
.filter-label { color: var(--muted); }

.filter-btn {
  background: var(--tag-bg);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 12px;
  transition: all 0.15s ease;
}
.filter-btn:hover {
  color: var(--heading);
  border-color: var(--border-strong);
}
.filter-btn.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  font-weight: 700;
}

.archive-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}
.archive-table th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 12px;
  border-bottom: 1px solid var(--border-strong);
}
.archive-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--fg);
}
.archive-year {
  font-family: var(--font-mono);
  color: var(--accent);
  width: 70px;
}
.archive-title { font-weight: 500; }
.badge {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--tag-bg);
  color: var(--muted);
  border: 1px solid var(--border);
}
.archive-links a {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
}
.archive-links a:hover { text-decoration: underline; }

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  text-align: center;
  padding: 64px 0 24px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

/* ==========================================================================
   Responsive (Tablets and Mobile)
   ========================================================================== */
@media (max-width: 900px) {
  .intro-splash { padding: 0 24px; }
  .content-flow { padding: 48px 24px 80px; }
  .section {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 60px 0;
  }
  .section__title { position: static; }
  .skill-grid { grid-template-columns: 1fr; }
  .theme-switch-wrapper { top: 16px; right: 16px; }
  .archive-table { font-size: 13px; }
}
