:root {
  --primary: #0f172a;
  --accent: #059669;
  --text: #1e293b;
  --muted: #64748b;
  --bg: #ffffff;
  --bg-alt: #f8fafc;
  --border: #e2e8f0;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

/* Nav */
nav {
  position: sticky;
  top: 0;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  padding: 0 2rem;
}

.nav-inner {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.nav-logo {
  font-weight: 700;
  font-size: 1rem;
  color: var(--primary);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

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

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

/* Main */
main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

/* Hero */
.hero {
  padding: 5rem 0 3.5rem;
}

.hero-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3rem;
}

.hero-text { flex: 1; }

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

.hero-photo img {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border);
  box-shadow: var(--shadow-md);
}

.hero-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.1;
  margin-bottom: 0.5rem;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--muted);
  margin-bottom: 2rem;
}

.hero-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
}

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

.btn-primary:hover { background: #1e293b; }

.btn-outline {
  border: 1.5px solid var(--border);
  color: var(--text);
  background: transparent;
}

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

/* Sections */
.section { margin-bottom: 3rem; }

.section-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

.bio p {
  color: var(--text);
  margin-bottom: 1rem;
  font-size: 0.975rem;
  line-height: 1.8;
}

/* Tags */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
}

/* Tech stack marquee */
.marquee-wrapper {
  overflow: hidden;
  width: 100%;
  -webkit-mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
  mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
}

.marquee-track {
  display: flex;
  align-items: center;
  gap: 3.5rem;
  width: max-content;
  animation: marquee 18s linear infinite;
}

.marquee-wrapper:hover .marquee-track {
  animation-play-state: paused;
}

.marquee-track img {
  height: 44px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}

@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* Page header */
.page-header {
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}

.page-header h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
}

.page-header p {
  color: var(--muted);
  margin-top: 0.5rem;
  font-size: 0.975rem;
}

/* Project cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.card-desc {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1rem;
  line-height: 1.6;
  flex: 1;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
}

/* Project cards (detailed) */
.project-card-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.project-card {
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  overflow: hidden;
  background: var(--bg);
}

.project-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.project-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
}

.project-card-body {
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.project-card-section p,
.project-card-section ul {
  font-size: 0.925rem;
  color: var(--text);
  line-height: 1.75;
  margin: 0;
}

.project-card-section ul {
  padding-left: 1.25rem;
}

.project-card-section ul li {
  margin-bottom: 0.3rem;
}

.project-card-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

/* Dynamon project sections */
.project {
  margin-bottom: 3.5rem;
  padding-bottom: 3.5rem;
  border-bottom: 1px solid var(--border);
}

.project:last-child { border-bottom: none; }

.project-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.project-title-row h2 {
  margin-bottom: 0;
}

.btn-sm {
  padding: 0.4rem 0.9rem;
  font-size: 0.8rem;
  white-space: nowrap;
}

.project-card-links {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.project h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1.5rem;
}

.project h3 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.75rem;
  margin-top: 1.5rem;
}

.project p {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.75;
  margin-bottom: 0.75rem;
}

.project ul {
  padding-left: 1.25rem;
  margin-bottom: 0.75rem;
}

.project ul li {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.75;
  margin-bottom: 0.4rem;
}

/* TCO Table */
.tco-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 1.5rem 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.tco-table th {
  background: var(--primary);
  color: white;
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.85rem;
}

.tco-table th:not(:first-child) { text-align: center; }

.tco-table td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
}

.tco-table td:not(:first-child) { text-align: center; }

.tco-table tr:last-child td { border-bottom: none; }
.tco-table tr:nth-child(even) td { background: var(--bg-alt); }

.tco-table tr.parent td {
  font-weight: 700;
  color: var(--primary);
  background: #f1f5f9;
}

.tco-table .indent {
  padding-left: 2.25rem;
  color: var(--muted);
  font-weight: 400;
}

.tco-table tr td.change-pos,
.tco-table tr.parent td.change-pos { color: #dc2626; font-weight: 600; }
.tco-table tr td.change-neg,
.tco-table tr.parent td.change-neg { color: #059669; font-weight: 600; }

/* Chart */
.chart-container { margin: 1.5rem 0; }

.chart-container img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.chart-caption {
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
  margin-top: 0.75rem;
  font-style: italic;
}

/* Enactus section header with logo */
.enactus-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.enactus-logo {
  height: 64px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.enactus-header h2 {
  margin-bottom: 0.25rem;
}

/* Photo grid (3-up) */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin: 1.25rem 0;
}

.photo-grid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

/* 5-photo achievement grid: 3 on top, 2 on bottom centred */
.photo-grid-5 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin: 1.25rem 0;
}

.photo-grid-5 img:nth-child(4) {
  grid-column: 1 / 2;
  margin-left: auto;
  width: 100%;
}

.photo-grid-5 img:nth-child(5) {
  grid-column: 2 / 3;
  width: 100%;
}

.photo-grid-5 img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

/* Achievement with photo alongside */
.achievement-with-photo {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: start;
  margin-bottom: 0.75rem;
}

.achievement-with-photo .achievement {
  margin-bottom: 0;
}

.achievement-photos {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex-shrink: 0;
}

.achievement-photos img {
  width: 220px;
  height: 140px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

@media (max-width: 640px) {
  .achievement-with-photo {
    grid-template-columns: 1fr;
  }
  .achievement-photos img {
    width: 100%;
    height: 180px;
  }
}

/* Volunteering stats */
.enactus-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1.5rem 0;
}

.stat-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
}

.stat-number {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--accent);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.25rem;
  line-height: 1.4;
}

.achievement {
  background: var(--bg-alt);
  border-left: 3px solid var(--accent);
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  border-radius: 0 var(--radius) var(--radius) 0;
}

.achievement-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--primary);
}

.achievement-desc {
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 0.25rem;
  line-height: 1.5;
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 640px) {
  .hero h1 { font-size: 2rem; }
  .hero-content { flex-direction: column-reverse; align-items: flex-start; gap: 1.5rem; }
  .hero-photo img { width: 120px; height: 120px; }
  .enactus-stats { grid-template-columns: 1fr; }
  .nav-links { gap: 1rem; }
  .nav-links a { font-size: 0.8rem; }
}
