:root {
  --bg-color: #f3f2ef;
  /* LinkedIn-like whitesmoke */
  --card-bg: #ffffff;
  --text-primary: #191919;
  /* LinkedIn dark grey */
  --text-secondary: #666666;
  --link-color: #0a66c2;
  /* LinkedIn blue */
  --border-radius: 8px;
  --spacing: 12px;
  --header-height: 52px;
}

html {
  box-sizing: border-box;
  overflow-y: scroll;
  /* Force scrollbar to prevent layout shift */
}

*,
*:after,
*:before {
  box-sizing: inherit;
}

body {
  margin: 0;
  background-color: var(--bg-color);
  /* Fallback */
  /* Fake the fixed header background on the body to prevent white flash */
  background-image: linear-gradient(to bottom, #1d2226 var(--header-height), var(--bg-color) var(--header-height));
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Fira Sans", Ubuntu, Oxygen, "Oxygen Sans", Cantarell, "Droid Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Lucida Grande", Helvetica, Arial, sans-serif;
  line-height: 1.5;
  padding-top: var(--header-height);
  /* Restore space for fixed header */
}

a {
  text-decoration: none;
  color: inherit;
}

a:hover {
  text-decoration: underline;
}

ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Header */
header {
  background-color: #1d2226;
  color: white;
  position: fixed;
  top: 0;
  left: 0;
  /* Ensure anchored to left */
  width: 100%;
  height: var(--header-height);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transform: translateZ(0);
  /* Force hardware acceleration for mobile stability */
}

nav {
  width: 100%;
  max-width: 800px;
  /* Match main content width */
  padding: 0 12px;
  /* Match main padding */
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid white;
}

nav ul {
  display: flex;
  gap: 24px;
}

nav a {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
  font-weight: 600;
  transition: color 0.2s;
}

nav a:hover,
nav a.active {
  color: white;
  text-decoration: none;
}

.alx-logo {
  height: 24px;
  width: auto;
  vertical-align: middle;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.alx-logo:hover {
  opacity: 1;
}

/* Main Layout */
main {
  max-width: 800px;
  /* Centered column */
  margin: 24px auto;
  padding: 0 12px;
  display: flex;
  flex-direction: column;
  gap: var(--spacing);
}

/* Cards */
.card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.05);
  /* Subtle border/shadow */
  overflow: hidden;
  margin-bottom: var(--spacing);
}

/* Profile Card Specifics */
.profile-card {
  position: relative;
  padding-bottom: 16px;
}

.cover-photo {
  height: 200px;
  background: #a0b4b7;
  /* Fallback */
  background: radial-gradient(circle at 50% 50%, #7d9ca0 0%, #a0b4b7 100%);
  /* Decorative gradient */
}

.profile-info {
  padding: 0 24px;
  margin-top: -80px;
  /* Overlap cover */
  position: relative;
}

.avatar {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 4px solid white;
  background-color: white;
  object-fit: cover;
  margin-bottom: 16px;
}

.profile-details h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 4px 0;
}

.profile-details h2 {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-primary);
  margin: 0 0 8px 0;
}

.location {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.profile-socials {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.profile-socials a {
  font-size: 1.2rem;
  color: var(--text-secondary);
  transition: color 0.2s;
}

.profile-socials a:hover {
  color: var(--link-color);
}

.profile-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.btn {
  padding: 6px 16px;
  border-radius: 16px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s;
  border: 1px solid transparent;
}

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

.btn-primary:hover {
  background-color: #004182;
  text-decoration: none;
}

.btn-secondary {
  background-color: transparent;
  color: var(--link-color);
  border-color: var(--link-color);
}

.btn-secondary:hover {
  background-color: rgba(10, 102, 194, 0.1);
  text-decoration: none;
  border-width: 2px;
  /* LinkedIn style often thickens border on hover or is already thick */
  padding: 5px 15px;
  /* Adjust for border width change if needed, or just keep simple */
  border-width: 1px;
  /* Reset */
  box-shadow: inset 0 0 0 1px var(--link-color);
  /* Faux thick border */
}

/* Section Cards (About, Projects) */
.section-card {
  padding: 24px;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 16px 0;
}

.about-text {
  font-size: 0.95rem;
  /* Slightly larger for readability */
  color: var(--text-primary);
  line-height: 1.6;
  /* Better readability */
}

.about-text p {
  margin: 0 0 16px 0;
}

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

.about-text h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 24px 0 8px 0;
  color: var(--text-primary);
}

.about-text ul {
  margin: 0 0 16px 0;
  padding-left: 20px;
  list-style-type: disc;
}

.about-text li {
  margin-bottom: 4px;
}

/* Projects List */
.project-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.project-item {
  display: flex;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #eee;
}

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

.project-icon {
  width: 48px;
  height: 48px;
  background-color: #f3f2ef;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--text-secondary);
}

.project-details {
  flex: 1;
}

.project-name {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 4px 0;
  display: block;
}

.project-desc {
  font-size: 0.9rem;
  color: var(--text-primary);
  margin: 0;
}

.project-meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.project-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: color 0.2s;
}

.project-link:hover {
  color: var(--link-color);
  text-decoration: none;
}

.project-link i {
  margin-left: 4px;
  font-size: 0.8em;
  transition: transform 0.2s;
}

.project-link:hover i {
  transform: translateX(4px);
}

.project-name:hover {
  color: var(--link-color);
  text-decoration: underline;
}

/* Footer */
footer {
  text-align: center;
  padding: 24px 0;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.footer-socials {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 8px;
}

.footer-socials a {
  font-size: 1.2rem;
  color: var(--text-secondary);
}

.footer-socials a:hover {
  color: var(--link-color);
}

/* Responsive */
@media (max-width: 768px) {
  .profile-info {
    margin-top: -60px;
  }

  .avatar {
    width: 120px;
    height: 120px;
  }
}