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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* === Design Tokens === */
:root {
  --primary: #1B4332;
  --primary-hover: #2D6A4F;
  --accent: #52B788;
  --accent-light: #D8F3DC;
  --bg: #FFFFFF;
  --bg-alt: #F8FAF9;
  --bg-card: #FFFFFF;
  --text: #1A202C;
  --text-muted: #4B5563;
  --border: #E5E7EB;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 24px rgba(27, 67, 50, 0.12);
  --radius: 14px;
  --radius-sm: 8px;
  --transition: 0.2s ease;
}

/* === Layout === */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 96px 0;
}

/* === Construction Banner === */
.construction-banner {
  background: var(--primary);
  color: #86efac;
  text-align: center;
  padding: 10px 24px;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* === Navigation === */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.site-header.scrolled {
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo {
  font-size: 1.1875rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 36px;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: color var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
  transition: var(--transition);
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* === Hero === */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: url('../assets/photos/hero-bg.jpg') center/cover no-repeat;
  padding: 100px 24px 60px;
}

.hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 60px;
  padding: 48px 52px;
  position: relative;
  z-index: 1;
  width: 100%;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 24px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.22);
}

.hero-content {
  flex: 1;
  max-width: 580px;
}

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

.profile-photo {
  width: 300px;
  height: 300px;
  border-radius: var(--radius);
  object-fit: cover;
  border: 5px solid white;
  box-shadow: 0 8px 32px rgba(27, 67, 50, 0.2);
  display: block;
}

.hero-eyebrow {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.hero-name {
  font-size: clamp(2.75rem, 7vw, 4.75rem);
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin-bottom: 16px;
}

.hero-subtitle {
  font-size: clamp(1.0625rem, 2.5vw, 1.375rem);
  color: var(--primary-hover);
  font-weight: 500;
  margin-bottom: 24px;
}

.hero-description {
  font-size: 1.0625rem;
  color: #374151;
  max-width: 560px;
  line-height: 1.75;
  margin-bottom: 44px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.hero-decoration {
  display: none;
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition);
  cursor: pointer;
  border: 2px solid transparent;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(27, 67, 50, 0.28);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
}

/* === Section Titles === */
.section-title {
  font-size: clamp(1.875rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.025em;
  margin-bottom: 52px;
}

.section-title::after {
  content: '';
  display: block;
  width: 44px;
  height: 4px;
  background: var(--accent);
  border-radius: 2px;
  margin-top: 14px;
}

/* === About === */
.about {
  background: var(--bg);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 72px;
  align-items: start;
}

.about-text p {
  color: var(--text-muted);
  line-height: 1.8;
  font-size: 1.0625rem;
  margin-bottom: 20px;
}

.about-text p:last-child {
  margin-bottom: 0;
}

.about-skills h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 24px;
}

.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

.skill-group h4 {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.skill-group ul {
  list-style: none;
}

.skill-group li {
  color: var(--text-muted);
  font-size: 0.9375rem;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.skill-group li:last-child {
  border-bottom: none;
}

/* === Education === */
.education {
  background: var(--bg-alt);
}

.education-grid {
  display: flex;
  gap: 24px;
}

.education-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  flex: 1;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

@media (max-width: 768px) {
  .education-grid {
    flex-direction: column;
  }
}

.education-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-lg);
}

.education-card-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}

.education-icon {
  font-size: 2.25rem;
  line-height: 1;
  flex-shrink: 0;
}

.education-meta h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 4px;
}

.education-institution {
  color: var(--accent);
  font-size: 0.9375rem;
  font-weight: 500;
}

.education-description {
  color: var(--text-muted);
  font-size: 1.0625rem;
  line-height: 1.8;
  margin-bottom: 24px;
}

.thesis-link {
  display: inline-flex;
  align-items: center;
  color: var(--primary);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 600;
  transition: color var(--transition);
}

.thesis-link:hover {
  color: var(--accent);
}

/* === Projects === */
.projects {
  background: var(--bg-alt);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 24px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.project-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-lg);
  transform: translateY(-5px);
}

.project-icon {
  font-size: 2rem;
  margin-bottom: 18px;
  line-height: 1;
}

.project-card h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 12px;
  line-height: 1.3;
}

.project-card p {
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.75;
  flex-grow: 1;
  margin-bottom: 22px;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.tag {
  background: var(--accent-light);
  color: var(--primary-hover);
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 500;
}

.project-links {
  display: flex;
  gap: 16px;
  margin-top: auto;
}

.project-link {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 600;
  transition: color var(--transition);
}

.project-link:hover {
  color: var(--accent);
}

/* === Photos === */
.photos {
  background: var(--bg-alt);
}

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

.photo-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 0;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.photo-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.photo-card img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  display: block;
  cursor: pointer;
}

.photo-placeholder {
  width: 100%;
  height: 240px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--border);
}

.photo-card figcaption {
  padding: 14px 18px;
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* === Resume === */
.resume {
  background: var(--bg);
}

.resume-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 0;
}

.resume-section-header .section-title {
  margin-bottom: 52px;
}

.resume-download-btn {
  margin-top: 6px;
  flex-shrink: 0;
}

.resume-print-header {
  display: none;
}

.resume-summary {
  max-width: 720px;
  margin-bottom: 48px;
}

.resume-summary p {
  color: var(--text-muted);
  font-size: 1.0625rem;
  line-height: 1.8;
}

.resume-block {
  margin-bottom: 48px;
}

.resume-block:last-child {
  margin-bottom: 0;
}

.resume-block-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 20px;
}

.resume-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.resume-entries {
  border-left: 2px solid var(--border);
  padding-left: 24px;
}

.resume-entry {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

.resume-entry:last-child {
  border-bottom: none;
}

.resume-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
}

.resume-entry-org {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 2px;
}

.resume-entry-role {
  color: var(--accent);
  font-size: 0.9375rem;
  font-weight: 500;
}

.resume-entry-date {
  color: var(--text-muted);
  font-size: 0.875rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.resume-entry ul {
  list-style: none;
  padding: 0;
}

.resume-entry li {
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.6;
  padding: 4px 0 4px 16px;
  position: relative;
}

.resume-entry li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* === Lightbox === */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lightbox.open {
  display: flex;
}

.lightbox-img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: white;
  font-size: 2.25rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity var(--transition);
}

.lightbox-close:hover {
  opacity: 1;
}

/* === Demo Modals === */
.demo-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.demo-modal.open {
  display: flex;
}

.demo-modal-dialog {
  background: var(--bg);
  border-radius: var(--radius);
  width: 100%;
  max-width: 880px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
}

.demo-modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
  z-index: 10;
  transition: color var(--transition);
}

.demo-modal-close:hover {
  color: var(--text);
}

.demo-badge {
  display: inline-block;
  background: #FEF3C7;
  color: #92400E;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.project-demo-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

/* --- Phenology Streamlit-style demo --- */
.st-modal-dialog {
  max-width: 980px !important;
  padding: 0;
  overflow: hidden;
}

.st-app {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 88vh;
  overflow: hidden;
  font-size: 0.8125rem;
}

.st-topbar {
  background: var(--primary);
  color: white;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.st-topbar-title {
  font-weight: 600;
  font-size: 0.9375rem;
  flex: 1;
}

.st-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Sidebar */
.st-sidebar {
  width: 210px;
  flex-shrink: 0;
  background: #1C3A2C;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

.st-sb-heading {
  color: #a7f3d0;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 6px;
}

.st-sb-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.st-file-drop {
  background: rgba(255,255,255,0.07);
  border: 1px dashed rgba(255,255,255,0.22);
  border-radius: 6px;
  padding: 10px 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-align: center;
}

.st-file-icon { font-size: 1.25rem; }
.st-file-text { color: #d1fae5; font-size: 0.75rem; font-weight: 500; }
.st-file-hint { color: rgba(255,255,255,0.4); font-size: 0.6875rem; }

.st-sb-subtext {
  color: rgba(255,255,255,0.4);
  font-size: 0.6875rem;
  margin-top: 4px;
}

.st-sb-textarea {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 4px;
  padding: 5px 8px;
  color: rgba(255,255,255,0.6);
  font-size: 0.6875rem;
  font-family: monospace;
}

.st-sb-divider {
  height: 1px;
  background: rgba(255,255,255,0.1);
}

.st-sb-expander {
  color: #86efac;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: default;
}

.st-pkg-ok {
  color: #6ee7b7;
  font-size: 0.6875rem;
  background: rgba(110,231,183,0.1);
  border: 1px solid rgba(110,231,183,0.25);
  border-radius: 4px;
  padding: 5px 8px;
}

.st-sb-note {
  color: rgba(255,255,255,0.25);
  font-size: 0.6875rem;
  margin-top: auto;
}

/* Main area */
.st-main {
  flex: 1;
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  min-width: 0;
  background: #fff;
}

.st-success-banner {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
  border-radius: 6px;
  padding: 7px 12px;
  font-size: 0.8125rem;
  font-weight: 500;
}

/* Control rows */
.st-ctrl-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.st-ctrl {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 120px;
}

.st-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.st-multisel {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 7px;
  min-height: 32px;
}

.st-chip {
  background: var(--accent-light);
  color: var(--primary-hover);
  border-radius: 4px;
  padding: 1px 7px;
  font-size: 0.6875rem;
  font-weight: 500;
  white-space: nowrap;
}

.st-sel {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 0.8125rem;
  font-family: inherit;
  background: var(--bg-alt);
  color: var(--text);
  cursor: pointer;
}

.st-slider-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.st-slider {
  flex: 1;
  accent-color: var(--accent);
  cursor: pointer;
}

.st-slider-val {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--primary);
  min-width: 32px;
}

.st-radio-grp {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.st-radio-opt {
  flex: 1;
  padding: 5px 10px;
  font-size: 0.8125rem;
  cursor: pointer;
  text-align: center;
  background: var(--bg-alt);
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
}

.st-radio-opt input { display: none; }

.st-radio-active {
  background: var(--primary);
  color: white;
}

/* Tabs */
.st-tabs-bar {
  display: flex;
  border-bottom: 2px solid var(--border);
  gap: 0;
  flex-shrink: 0;
}

.st-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
  font-family: inherit;
}

.st-tab:hover { color: var(--primary); }

.st-tab-active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

/* Panels */
.st-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.st-panel-hidden { display: none !important; }

/* GAM config row */
.st-gam-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
}

.st-ctrl-sm {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.st-label-sm {
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.st-sel-sm {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 0.75rem;
  font-family: inherit;
  background: white;
}

.st-num {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 0.75rem;
  font-family: inherit;
  width: 62px;
}

/* Sub-tabs */
.st-subtabs-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
  border-radius: 6px 6px 0 0;
}

.st-subtab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 6px 14px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  transition: color var(--transition);
}

.st-subtab:hover { color: var(--primary); }

.st-subtab-active {
  color: var(--primary);
  border-bottom-color: var(--accent);
  background: white;
  border-radius: 6px 6px 0 0;
  font-weight: 600;
}

/* Sub-panels */
.st-subpanel {
  display: none;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 6px 6px;
  background: white;
}

.st-subpanel-active { display: flex; }

/* Chart */
.st-chart-wrap {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 10px 6px;
}

.pheno-svg {
  width: 100%;
  height: auto;
  display: block;
}

.st-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 6px;
  padding: 0 4px;
}

.st-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.st-legend-line {
  display: inline-block;
  width: 22px;
  height: 3px;
  border-radius: 2px;
}

.st-legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  opacity: 0.5;
}

/* Download row */
.st-dl-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.st-dl-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 0.8125rem;
  font-family: inherit;
  cursor: pointer;
  color: var(--text-muted);
  transition: border-color var(--transition), color var(--transition);
}

.st-dl-btn:hover {
  border-color: var(--accent);
  color: var(--primary);
}

.st-note {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Tables */
.st-tbl-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.st-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
}

.st-tbl th {
  background: var(--bg-alt);
  padding: 6px 10px;
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.st-tbl td {
  padding: 5px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  white-space: nowrap;
}

.st-tbl tr:last-child td { border-bottom: none; }
.st-tbl tr:hover td { background: #f8fdf9; }

/* Compare panel */
.st-compare-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 14px;
}

.st-toggle-lbl {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  cursor: pointer;
  color: var(--text);
}

.st-toggle-lbl input[type="checkbox"] {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
  cursor: pointer;
}

/* Responsive */
@media (max-width: 700px) {
  .st-layout { flex-direction: column; }
  .st-sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; padding: 10px 12px; }
  .st-sb-section { min-width: 140px; flex: 1; }
  .st-sb-note { display: none; }
  .st-gam-row { gap: 6px; }
  .st-modal-dialog { max-height: 95vh !important; }
}

/* --- Commuter app (new) --- */
.commuter-modal-dialog {
  max-width: 820px !important;
  padding: 0;
}

.commuter-new-wrap {
  display: flex;
  gap: 0;
  min-height: 560px;
  max-height: 88vh;
  overflow: hidden;
}

/* Phone frame */
.commuter-phone {
  width: 340px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: #f8fafc;
  border-right: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.commuter-phone-bar {
  background: #1e40af;
  color: white;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.commuter-phone-title {
  font-weight: 700;
  font-size: 1rem;
}

/* Pages */
.commuter-page {
  flex: 1;
  overflow-y: auto;
  padding: 0 0 60px;
  display: flex;
  flex-direction: column;
}

.commuter-page-hidden { display: none !important; }

/* Quarter banner */
.commuter-quarter-banner {
  background: #dbeafe;
  color: #1e40af;
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  padding: 5px 0;
}

/* Month navigation */
.commuter-month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 6px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--primary);
}

.commuter-nav-arrow {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 28px;
  height: 28px;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

.commuter-nav-arrow:hover:not(:disabled) {
  background: var(--bg-alt);
  color: var(--primary);
}

.commuter-nav-arrow:disabled { opacity: 0.3; cursor: not-allowed; }

/* Log card */
.commuter-log-card {
  margin: 0 14px 10px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  min-height: 80px;
  font-size: 0.875rem;
}

.cc-date-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.cc-date-badge {
  background: #dbeafe;
  color: #1e40af;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cc-date-full {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.cc-status {
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 8px;
}

.cc-status-yes { background: #dcfce7; color: #166534; }
.cc-status-no  { background: #f3f4f6; color: #374151; }

.cc-prompt {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 10px;
}

.cc-action-btns {
  display: flex;
  gap: 8px;
}

.cc-yes-btn, .cc-no-btn {
  flex: 1;
  padding: 9px;
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: opacity var(--transition);
}

.cc-yes-btn { background: #22c55e; color: white; }
.cc-yes-btn:hover { opacity: 0.85; }
.cc-no-btn  { background: #e5e7eb; color: #374151; }
.cc-no-btn:hover { background: #d1d5db; }

.cc-undo-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 0.8125rem;
  cursor: pointer;
  color: var(--text-muted);
  font-family: inherit;
}

/* Calendar grid */
.commuter-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  padding: 0 14px;
}

.cc-dow {
  text-align: center;
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 3px 0;
  text-transform: uppercase;
}

.cc-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background var(--transition), border-color var(--transition);
  color: var(--text);
  font-weight: 400;
}

.cc-day:hover:not(.cc-future) { background: #eff6ff; border-color: #93c5fd; }
.cc-commuted { background: #dcfce7 !important; color: #166534 !important; font-weight: 600; }
.cc-absent   { background: #f3f4f6 !important; color: #6b7280 !important; }
.cc-today    { font-weight: 700; text-decoration: underline; }
.cc-selected { border: 2px solid #3b82f6 !important; }
.cc-future   { color: #d1d5db; cursor: default; }

/* Legend */
.commuter-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px 6px;
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.cc-legend-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.cc-legend-dot.cc-commuted { background: #dcfce7; border: 1px solid #22c55e; }
.cc-legend-dot.cc-absent   { background: #f3f4f6; border: 1px solid #d1d5db; }
.cc-legend-dot.cc-unlogged { background: white;   border: 1px solid #d1d5db; }

/* Export page */
.commuter-export-wrap {
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.commuter-export-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
}

.commuter-export-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.commuter-export-stat {
  background: #dbeafe;
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.commuter-export-num {
  font-size: 2rem;
  font-weight: 800;
  color: #1e40af;
}

.commuter-export-label {
  font-size: 0.75rem;
  color: #3b82f6;
  font-weight: 500;
}

.commuter-export-months {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.commuter-export-month-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.875rem;
  color: var(--text);
}

.commuter-export-month-row.active { border-color: #3b82f6; background: #eff6ff; }

.commuter-export-badge {
  font-size: 0.6875rem;
  font-weight: 600;
  color: #166534;
  background: #dcfce7;
  padding: 2px 8px;
  border-radius: 999px;
}

.commuter-dl-export-btn {
  background: #1e40af;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 11px 14px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: opacity var(--transition);
}

.commuter-dl-export-btn:hover { opacity: 0.85; }

.commuter-dl-quarter-btn {
  background: white;
  color: #1e40af;
  border: 1px solid #1e40af;
}

.commuter-export-note {
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-align: center;
}

/* Settings page */
.commuter-settings-wrap {
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.commuter-settings-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
}

.commuter-settings-group {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
}

.commuter-settings-label {
  font-size: 0.625rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 3px;
}

.commuter-settings-field {
  font-size: 0.875rem;
  color: var(--text);
  font-weight: 500;
}

.commuter-settings-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.875rem;
  color: var(--text);
}

.commuter-toggle-pill {
  background: #e5e7eb;
  color: #6b7280;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
}

.commuter-toggle-pill.active {
  background: #22c55e;
  color: white;
}

/* Bottom navigation */
.commuter-bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  background: white;
  border-top: 1px solid var(--border);
}

.commuter-nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px 10px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.625rem;
  font-weight: 600;
  color: #9ca3af;
  font-family: inherit;
  transition: color var(--transition);
}

.commuter-nav-btn span:first-child { font-size: 1.1rem; }
.commuter-nav-btn:hover { color: #374151; }
.commuter-nav-active { color: #1e40af !important; }

/* Info panel */
.commuter-info-panel {
  flex: 1;
  padding: 28px 28px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.commuter-info-panel h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 2px;
}

.commuter-info-panel p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.commuter-info-panel ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.commuter-info-panel li {
  font-size: 0.875rem;
  color: var(--text-muted);
  padding-left: 16px;
  position: relative;
}

.commuter-info-panel li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--accent);
}

.commuter-tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

@media (max-width: 640px) {
  .commuter-new-wrap { flex-direction: column; }
  .commuter-phone { width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
  .commuter-info-panel { padding: 18px; }
}

/* === Contact === */
.contact {
  background: var(--primary);
}

.contact .section-title {
  color: white;
}

.contact .section-title::after {
  background: var(--accent);
}

.contact-description {
  color: #86efac;
  font-size: 1.0625rem;
  max-width: 520px;
  margin-bottom: 44px;
  line-height: 1.75;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  text-decoration: none;
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.9375rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}

.contact-link:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateY(-2px);
}

.contact-icon {
  display: flex;
  align-items: center;
}

/* === Footer === */
.site-footer {
  background: #0F2419;
  color: #6B7280;
  padding: 24px 0;
  text-align: center;
  font-size: 0.875rem;
}

/* === Scroll Animations === */
.fade-in {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* === Responsive === */
@media (max-width: 768px) {
  .section {
    padding: 72px 0;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: white;
    flex-direction: column;
    padding: 20px 24px 28px;
    gap: 0;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    display: none;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links li {
    border-bottom: 1px solid var(--border);
  }

  .nav-links li:last-child {
    border-bottom: none;
  }

  .nav-links a {
    display: block;
    padding: 14px 0;
  }

  .hero-inner {
    flex-direction: column-reverse;
    gap: 32px;
    padding: 32px 28px;
  }

  .profile-photo {
    width: 180px;
    height: 180px;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .skills-grid {
    grid-template-columns: 1fr 1fr;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .contact-links {
    flex-direction: column;
  }

  .resume-entry-header {
    flex-direction: column;
    gap: 4px;
  }

  .resume-entry-date {
    white-space: normal;
  }
}

@media (max-width: 480px) {
  .skills-grid {
    grid-template-columns: 1fr;
  }

  .hero-decoration {
    display: none;
  }
}

/* === Print (resume PDF download) === */
@media print {
  @page { margin: 1.5cm 2cm; }

  .construction-banner,
  .site-header,
  #hero,
  #about,
  #education,
  #projects,
  #photos,
  #contact,
  .site-footer,
  .resume-download-btn {
    display: none !important;
  }

  body {
    color: #111;
    background: white;
    font-size: 11pt;
    line-height: 1.5;
  }

  #resume {
    padding: 0;
  }

  .container {
    max-width: 100%;
    padding: 0;
  }

  .resume-print-header {
    display: block;
    margin-bottom: 20pt;
    padding-bottom: 10pt;
    border-bottom: 2px solid #111;
  }

  .resume-print-header h1 {
    font-size: 22pt;
    color: #111;
    margin-bottom: 3pt;
  }

  .resume-print-header p {
    font-size: 10pt;
    color: #555;
  }

  .resume-section-header .section-title {
    margin-bottom: 18pt;
  }

  .section-title {
    color: #111;
    font-size: 18pt;
  }

  .section-title::after {
    background: #555;
  }

  .resume-block-title,
  .resume-entry-role {
    color: #1B4332;
  }

  .resume-entry-org {
    color: #111;
  }

  .resume-summary p,
  .resume-entry li,
  .resume-entry-date {
    color: #333;
  }

  .resume-entries {
    border-left-color: #ccc;
  }

  .resume-entry {
    border-bottom-color: #eee;
    page-break-inside: avoid;
  }

  .resume-block {
    page-break-inside: avoid;
  }

  .tag {
    background: #f0f0f0;
    color: #333;
    border-radius: 4px;
  }

  .fade-in {
    opacity: 1 !important;
    transform: none !important;
  }
}
