/* =========================================================
   Dr Xuanchi "Tom" Liu — Professional Engineering Profile
   Shared stylesheet
   ========================================================= */

:root {
  --navy: #0a1f33;
  --navy-dark: #071624;
  --charcoal: #33383d;
  --grey: #6b7280;
  --grey-light: #f4f6f8;
  --border: #e2e6ea;
  --teal: #2f6f6a;
  --teal-dark: #23524e;
  --blue: #35547c;
  --white: #ffffff;
  --radius: 6px;
  --max-width: 1120px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--charcoal);
  background: var(--white);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3, h4 {
  font-family: var(--font);
  color: var(--navy);
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 16px;
}

h1 { font-size: 2.4rem; }
h2 { font-size: 1.6rem; margin-top: 48px; }
h3 { font-size: 1.15rem; margin-top: 28px; }
h4 { margin-top: 20px; color: var(--teal-dark); text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.85rem; }

p { margin: 0 0 16px; color: var(--charcoal); }

ul, ol { margin: 0 0 16px; padding-left: 20px; }
li { margin-bottom: 6px; }

.section-lead {
  color: var(--grey);
  font-size: 1.05rem;
  max-width: 760px;
}

/* ---------- Header / Navigation ---------- */
.site-header {
  position: sticky;
  top: 0;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  max-width: var(--max-width);
  margin: 0 auto;
  position: relative;
}

.brand {
  font-weight: 700;
  color: var(--navy);
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}

.brand span {
  color: var(--teal);
}

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--charcoal);
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--navy);
  border-bottom-color: var(--teal);
  text-decoration: none;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--navy);
  margin: 4px 0;
}

@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }
  .nav-links.open { max-height: 480px; }
  .nav-links li { width: 100%; }
  .nav-links a {
    display: block;
    padding: 14px 24px;
    border-bottom: 1px solid var(--border);
  }
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(180deg, var(--grey-light) 0%, var(--white) 100%);
  border-bottom: 1px solid var(--border);
  padding: 72px 0 56px;
}

.hero-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
  flex-wrap: wrap-reverse;
}

.hero-text { flex: 1 1 480px; min-width: 280px; }

.hero-photo { flex-shrink: 0; }

.hero-photo img,
.profile-photo img {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: 0 6px 18px rgba(10, 31, 51, 0.08);
  display: block;
}

.profile-photo {
  margin: 24px 0 8px;
}

@media (max-width: 700px) {
  .hero-photo img, .profile-photo img { width: 150px; height: 150px; }
}

.hero .eyebrow {
  color: var(--teal-dark);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.82rem;
  margin-bottom: 14px;
}

.hero h1 { max-width: 820px; }

.hero .subtitle {
  color: var(--blue);
  font-weight: 600;
  font-size: 1.15rem;
  margin-bottom: 20px;
}

.hero .summary {
  max-width: 760px;
  color: var(--charcoal);
  font-size: 1.05rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.btn {
  display: inline-block;
  padding: 11px 20px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.92rem;
  border: 1px solid var(--navy);
  cursor: pointer;
}

.btn-primary {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}
.btn-primary:hover { background: var(--navy-dark); text-decoration: none; }

.btn-secondary {
  background: transparent;
  color: var(--navy);
  border-color: var(--border);
}
.btn-secondary:hover { border-color: var(--navy); text-decoration: none; }

.btn-teal {
  background: var(--teal);
  color: var(--white);
  border-color: var(--teal);
}
.btn-teal:hover { background: var(--teal-dark); text-decoration: none; }

/* ---------- Feature grid (Home) ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 32px;
}

.feature-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  background: var(--white);
}

.feature-card h3 {
  margin-top: 0;
  color: var(--navy);
  font-size: 1.05rem;
}

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

.tag-list li {
  background: var(--grey-light);
  border: 1px solid var(--border);
  color: var(--charcoal);
  font-size: 0.8rem;
  padding: 5px 10px;
  border-radius: 999px;
  margin: 0;
}

/* ---------- Generic page sections ---------- */
.page-hero {
  padding: 56px 0 8px;
  border-bottom: 1px solid var(--border);
  background: var(--grey-light);
}

.page-hero .eyebrow {
  color: var(--teal-dark);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.82rem;
  margin-bottom: 10px;
}

.page-hero h1 { margin-bottom: 10px; }

main section {
  padding: 48px 0;
}

main section.tight { padding: 24px 0; }

hr.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 8px 0 0;
}

/* ---------- Experience / CV blocks ---------- */
.exp-item {
  border-left: 3px solid var(--teal);
  padding: 4px 0 4px 20px;
  margin-bottom: 32px;
}

.exp-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.exp-header h3 { margin: 0; color: var(--navy); }
.exp-period { color: var(--grey); font-size: 0.9rem; font-weight: 600; white-space: nowrap; }
.exp-role { color: var(--blue); font-weight: 600; font-size: 0.95rem; margin-bottom: 6px; }

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 28px;
}

.skills-grid h4 { margin-top: 0; }

table.cv-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 24px;
}

table.cv-table th, table.cv-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
  vertical-align: top;
}

table.cv-table th {
  color: var(--navy);
  font-weight: 700;
  background: var(--grey-light);
}

/* ---------- Projects (case studies) ---------- */
.project-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  background: var(--white);
}

.project-card summary {
  cursor: pointer;
  list-style: none;
  padding: 18px 22px;
  font-weight: 700;
  color: var(--navy);
  font-size: 1.02rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.project-card summary::-webkit-details-marker { display: none; }

.project-card summary::after {
  content: "+";
  font-size: 1.3rem;
  color: var(--teal);
  font-weight: 400;
  flex-shrink: 0;
}

.project-card[open] summary::after { content: "\2212"; }

.project-card .project-body {
  padding: 0 22px 22px;
  border-top: 1px solid var(--border);
}

.project-body h4 { margin-top: 18px; }
.project-body h4:first-child { margin-top: 18px; }

.project-meta {
  color: var(--grey);
  font-size: 0.85rem;
  font-weight: 500;
}

/* ---------- Insights ---------- */
.insight-card {
  border-bottom: 1px solid var(--border);
  padding: 22px 0;
}

.insight-card h3 { margin-top: 0; }

.insight-tag {
  display: inline-block;
  background: var(--grey-light);
  color: var(--teal-dark);
  border: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  margin-bottom: 10px;
}

/* ---------- Contact ---------- */
.contact-list {
  list-style: none;
  padding: 0;
  margin: 24px 0;
}

.contact-list li {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 12px;
  align-items: baseline;
}

.contact-list .label {
  min-width: 140px;
  font-weight: 600;
  color: var(--navy);
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--grey-light);
  padding: 32px 0;
  margin-top: 40px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.footer-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links a { color: var(--charcoal); font-size: 0.88rem; }
.footer-note { color: var(--grey); font-size: 0.85rem; margin: 0; }

@media (max-width: 600px) {
  h1 { font-size: 1.85rem; }
  .hero { padding: 48px 0 40px; }
  .exp-header { flex-direction: column; align-items: flex-start; }
}
