@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500&display=swap');

/* ─── RESET & TOKENS ─── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: none; /* override the * { border: 1px solid black } in EJS */
}

:root {
  --ink:          #0f0e0c;
  --paper:        #f8f6f1;
  --accent:       #2b5c3f;
  --accent-light: #d4e8db;
  --muted:        #6b6760;
  --rule:         #e0ddd6;
  --serif:        'DM Serif Display', Georgia, serif;
  --sans:         'DM Sans', system-ui, sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  margin: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover { color: var(--ink); }

/* ─── LIVE CLIENT COUNT ─── */
#live_client_count {
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.5rem 2rem;
  text-align: center;
}

#live_client_count p {
  margin: 0;
}

/* ─── LAYOUT ─── */
.layout-wrapper {
  display: grid;
  grid-template-areas: "left right";
  grid-template-columns: 1fr 2fr;
  min-height: 100vh;
}

/* ─── LEFT SIDEBAR ─── */
.left {
  border-right: 1px solid var(--rule);
}

.left-content {
  position: sticky;
  top: 0;
  padding: 3.5rem 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  min-height: 100vh;
}

.left-content h1 {
  font-family: var(--serif);
  font-size: 2rem;
  line-height: 1.1;
  color: var(--ink);
}

.left-content h2 {
  font-size: 1rem;
  font-weight: 300;
  color: var(--muted);
  line-height: 1.4;
}

.left-content h2 strong {
  color: var(--accent);
  font-weight: 500;
}

.left-content p {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.7;
  max-width: 28ch;
}

.left-content ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-top: 1rem;
  border-top: 1px solid var(--rule);
  padding-top: 1.5rem;
}

.left-content ul li a {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  padding: 0.4rem 0;
  transition: color 0.2s, padding-left 0.2s;
}

.left-content ul li a:hover {
  color: var(--accent);
  padding-left: 0.4rem;
}

.left-content ul li a.active {
  color: var(--accent);
  font-size: 0.72rem; /* override the EJS .active font-size: 20px */
  background: none;   /* override yellow background */
  padding-left: 0.4rem;
  border-left: 2px solid var(--accent);
}

/* ─── RIGHT CONTENT ─── */
.right {
  padding: 3.5rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.right > p {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.75;
  max-width: 60ch;
  margin-bottom: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--rule);
}

/* ─── SECTIONS ─── */
section {
  padding: 3rem 0;
  border-bottom: 1px solid var(--rule);
}

section:last-child {
  border-bottom: none;
}

section h3 {
  font-family: var(--serif);
  font-size: 1.5rem;
  color: var(--ink);
  margin-bottom: 2rem;
}

/* ─── WORK EXPERIENCE COMPONENT ─── */
work-experience {
  display: block;
  margin-bottom: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--rule);
}

work-experience:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.experience_wrapper {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1.5rem;
}

.duration {
  font-size: 0.78rem;
  color: var(--muted);
  padding-top: 0.2rem;
  line-height: 1.6;
}

.experience_wrapper header h4.title {
  font-family: var(--serif);
  font-size: 1.2rem;
  color: var(--ink);
  margin-bottom: 0.2rem;
}

.experience_wrapper header h5.company {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.04em;
  margin-bottom: 0.8rem;
}

.tech_stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  margin-bottom: 1rem;
}

.tech_stack li {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--rule);
  color: var(--muted);
  background: var(--paper);
}

.responsibilities h6 {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.details {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.details li {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.6;
  padding-left: 1rem;
  position: relative;
}

.details li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.7rem;
}

/* ─── OPEN SOURCE COMPONENT ─── */
open-source-contribution {
  display: block;
  margin-bottom: 2rem;
}

.open_source_wrapper {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1.5rem;
}

.open_source_wrapper .date {
  font-size: 0.78rem;
  color: var(--muted);
}

.open_source_wrapper h4.title {
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--ink);
  margin-bottom: 0.6rem;
}

.open_source_wrapper .techStack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  margin-bottom: 0.8rem;
}

.open_source_wrapper .techStack li {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--rule);
  color: var(--muted);
}

/* ─── PROJECTS COMPONENT ─── */
custom-project {
  display: block;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--rule);
}

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

.custom-project_wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.custom-project_wrapper h4.title {
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--ink);
}

.custom-project_wrapper h4.description {
  font-size: 0.88rem;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.6;
}

.custom-project_wrapper h4.live a {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.04em;
}

/* ─── EDUCATION COMPONENT ─── */
custom-education {
  display: block;
  margin-bottom: 1.5rem;
}

.education_wrapper {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1.5rem;
}

.education_wrapper .date {
  font-size: 0.78rem;
  color: var(--muted);
}

.education_wrapper h4.degree {
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--ink);
}

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  .layout-wrapper {
    display: flex;
    flex-direction: column;
  }

  .left {
    border-right: none;
    border-bottom: 1px solid var(--rule);
  }

  .left-content {
    position: relative;
    min-height: auto;
    padding: 2rem 1.5rem;
  }

  .right {
    padding: 2rem 1.5rem;
  }

  .experience_wrapper,
  .open_source_wrapper,
  .education_wrapper {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto; }
}
