:root {
  --bg-color: #ffffff;
  --text-main: #0f172a;
  --text-muted: #475569;
  --accent: #0f766e; /* A muted teal for accents */
  --border: #e2e8f0;
  --font-sans:
    "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Playfair Display", "Times New Roman", serif;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.5;
  font-size: 9.5pt;
  max-width: 21cm;
  margin: 0 auto;
  padding: 2rem;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid var(--text-main);
  padding-bottom: 0.5rem;
  margin-bottom: 0.75rem;
}

.header-main {
  flex-shrink: 0; /* Ensures the name container never gets squeezed */
  margin-right: 1.5rem;
}

h1 {
  font-family: var(--font-serif);
  font-size: 20pt;
  font-weight: 600;
  line-height: 1;
  color: var(--text-main);
  white-space: nowrap; /* Prevents the name from ever breaking into two lines */
}

.contact-info {
  display: grid;
  /* 3 Columns: Link/Span, Separator, Link/Span */
  grid-template-columns: auto min-content auto;
  column-gap: 0.75rem;
  row-gap: 0.25rem;
  align-items: center;
  justify-items: start;
  font-size: 8.5pt;
  color: var(--text-muted);
  line-height: 1.3;
  margin-top: 0.2rem; /* Optically aligns small text with large H1 top */
}

.contact-info > div {
  display: contents;
}

.contact-info a,
.contact-info span:not(.separator) {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.separator {
  margin: 0 0.35rem;
  color: var(--border);
  justify-self: center;
}

.contact-info span:not(.separator) {
  color: var(--text-muted);
  font-weight: 400;
}

.contact-info a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.contact-icon {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
}

/* New Profile Summary Styling */
.profile-summary {
  font-size: 10pt;
  font-weight: 500;
  color: var(--text-main);
  margin-bottom: 1.25rem;
  line-height: 1.6;
  padding-left: 1rem;
}

h2 {
  font-family: var(--font-serif);
  font-size: 13pt;
  color: var(--accent);
  font-style: italic;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.6rem;
  padding-bottom: 0.2rem;
}

.skills-section {
  margin-bottom: 1.25rem;
  font-size: 9.5pt;
}

.skills-section p {
  margin-bottom: 0.6rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.skills-section strong {
  color: var(--text-main);
  margin-right: 0.15rem;
}

.skill-tag {
  background-color: #f1f5f9;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  font-size: 8pt;
  font-weight: 500;
  white-space: nowrap;
}

.project {
  margin-bottom: 1.5rem;
  page-break-inside: avoid;
}

.project h3 {
  font-size: 11pt;
  font-weight: 600;
  margin-bottom: 0.1rem;
  color: var(--text-main);
}

.meta {
  font-size: 8.5pt;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.bullet-list {
  list-style-type: none; /* Removing the square to look cleaner */
  padding-left: 0;
}

.bullet-list li {
  margin-bottom: 0.4rem;
  color: var(--text-main);
  position: relative;
  padding-left: 1rem;
}

/* Custom minimal bullet point */
.bullet-list li::before {
  content: "→";
  color: var(--accent);
  position: absolute;
  left: 0;
  font-weight: bold;
}

.ext-link {
  font-size: 8.5pt;
  font-weight: normal;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-muted);
}

.inline-link {
  text-decoration: none;
  color: inherit;
  border-bottom: 1px dotted var(--border);
  transition: all 0.2s ease;
}

.inline-link:hover {
  color: var(--accent);
  border-bottom: 1px solid var(--accent);
}

.footer {
  display: flex;
  gap: 2rem;
  margin-top: 1.5rem;
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
}

.footer-col {
  flex: 1;
}

.footer-col h3 {
  font-size: 10pt;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  letter-spacing: 0.5px;
}

.footer-col p {
  margin-bottom: 0.3rem;
}

@media print {
  body {
    background: white !important;
    color: black !important;
    margin: 0;
    padding: 0;
    width: 100%;
  }

  /* Ensure link boxes exist for PDF URL annotation */
  .contact-info a {
    display: inline-flex !important;
  }

  /* .no-print,
  .ext-link {
    display: none;
  } */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  @page {
    size: A4;
    margin: 1.2cm;
  }
}
.project-footer {
  margin-top: 0.25rem;
  padding-left: 1rem;
  display: flex;
  align-items: center;
}

.ext-link {
  font-size: 8pt; /* Slightly smaller */
  color: var(--text-muted); /* Muted gray by default */
  text-decoration: none;
  font-weight: 400; /* Normal weight */
  transition: color 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.ext-link:hover {
  color: var(--accent); /* Only turns blue on hover */
  text-decoration: underline;
}

/* Custom minimal bullet point for the links if you want it even more subtle */
.project-footer a::before {
  content: ""; /* Removed the arrow to keep it clean */
}

/* --- MOBILE RESPONSIVENESS --- */
@media screen and (max-width: 768px) {
  body {
    padding: 1rem; /* Halve the padding to give content more room */
    max-width: 100%; /* Override the 21cm constraint */
    font-size: 10pt; /* Slightly bump base size for readability on phones */
  }

  /* Stack the header elements */
  header {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-main {
    margin-right: 0;
    margin-bottom: 1rem;
  }

  .contact-info,
  .contact-info div {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap; /* This is the magic property */
    gap: 0.5rem 1rem; /* 0.5rem row gap, 1rem column gap */
  }

  /* Keep separators hidden so they don't end up stranded on a new line */
  .contact-info .separator {
    display: none;
  }

  /* Ensure the SVG icons and text stay perfectly aligned inside the links */
  .contact-info a {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
  }

  /* Stack footer columns */
  .footer {
    flex-direction: column;
    gap: 1.5rem;
  }
}
