@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap');

:root {
  --color-bg: #ffffff;
  --color-bg-card: #f6f8fa;
  --color-text: #24292e;
  --color-link: #0366d6;
  --color-link-hover: #0556b8;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --font-mono: SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
  --spacing-unit: 16px;
  --border-radius: 12px;
  --shadow-light: 0 4px 6px rgba(32,33,36,0.1);
  --shadow-hover: 0 12px 24px rgba(3,102,214,0.25);
  --gradient-header: linear-gradient(135deg, #0366d6, #0556b8);
  --avatar-bg: #0366d6;
  --avatar-text: #ffffff;
}

/* Reset and base */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: calc(var(--spacing-unit) * 3);
  background: radial-gradient(circle at top left, #e1e4e8, #f6f8fa);
}

main {
  max-width: 680px;
  background: var(--color-bg-card);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-light);
  padding: calc(var(--spacing-unit) * 4);
  position: relative;
  overflow: visible;
  transition: box-shadow 0.3s ease;
}

main:hover,
main:focus-within {
  box-shadow: var(--shadow-hover);
  outline: none;
}

/* Brand top bar */
main::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 6px;
  border-radius: var(--border-radius) var(--border-radius) 0 0;
  background: var(--gradient-header);
  pointer-events: none;
}

header {
  display: flex;
  align-items: center;
  gap: calc(var(--spacing-unit) * 2);
  margin-bottom: calc(var(--spacing-unit) * 3);
}

.avatar {
  width: 72px;
  height: 72px;
  background-image: url('images/1.jpg');
  background-size: 180% 160%;    /* phóng to ảnh lên 120% so với container */
  background-position: center;   /* căn giữ ảnh ở giữa */
  background-repeat: no-repeat;   /* tránh lặp ảnh */
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(3,102,214,0.4);
  user-select: none;
}

header .info-header {
  flex-grow: 1;
}

header h1 {
  margin: 0;
  font-weight: 700;
  font-size: 2.8rem;
  line-height: 1.1;
  background: var(--gradient-header);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

header p {
  margin: 6px 0 0;
  font-size: 1.1rem;
  color: #444d56;
  font-style: italic;
}

section.info {
  margin-top: calc(var(--spacing-unit) * 1);
}

dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 16px 24px;
  align-items: center;
  font-size: 1.15rem;
  color: #333;
  word-break: break-word;
}

dt {
  font-weight: 600;
  color: #57606a;
}

dd {
  margin: 0;
}

section.links {
  margin-top: calc(var(--spacing-unit) * 4);
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
}

a.external-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  font-weight: 600;
  color: var(--color-link);
  font-size: 1.15rem;
  gap: 10px;
  transition: color 0.3s ease;
  position: relative;
  padding: 6px 8px;
  border-radius: 6px;
}

a.external-link::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 6px;
  transition: background-color 0.3s ease;
  z-index: -1;
}

a.external-link:hover,
a.external-link:focus-visible {
  color: var(--color-link-hover);
}

a.external-link:hover::before,
a.external-link:focus-visible::before {
  background-color: rgba(3,102,214,0.12);
}

svg.icon {
  width: 22px;
  height: 22px;
  fill: currentColor;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

a.external-link:hover svg.icon,
a.external-link:focus-visible svg.icon {
  transform: scale(1.1);
}

@media (max-width: 480px) {
  main {
    padding: calc(var(--spacing-unit) * 3);
  }
  dl {
    grid-template-columns: 1fr;
    gap: 8px 0;
  }
  dt {
    padding-bottom: 4px;
    border-bottom: 1px solid #e1e4e8;
  }
  dd {
    margin-bottom: 16px;
  }
  section.links {
    gap: 20px;
  }
  a.external-link {
    font-size: 1rem;
  }
  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .avatar {
    width: 64px;
    height: 64px;
    background-size: cover;
  }
  header h1 {
    font-size: 2rem;
  }
}

/* Visually hidden text for screen readers */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0,0,0,0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}



/* ========== Card chiếm full-width trên mobile ========= */
@media (max-width: 480px) {
  body {
    padding: 8px;          /* margin thân trang */
  }
  main {
    width: 100%;
    max-width: 100%;
    border-radius: 8px;
    padding: 20px 16px;    /* padding nhỏ lại */
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  }

  /* Căn giữa header */
  header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    margin-bottom: 24px;
  }
  .info-header h1 {
    font-size: 1.6rem;
  }
  .info-header p {
    font-size: 1rem;
    font-style: normal;
    color: #666;
  }

  /* Avatar to vừa phải */
  .avatar {
    width: 90px;
    height: 90px;
    background-size: 180% 160%;    /* phóng to ảnh lên 120% so với container */
    background-position: center;   /* căn giữ ảnh ở giữa */
    background-repeat: no-repeat;   /* tránh lặp ảnh */
    box-shadow: 0 2px 8px rgba(3,102,214,0.3);
  }

  /* Thông tin chi tiết */
  dl {
    display: block;
    padding: 0;
  }
  dt, dd {
    display: block;
    width: 100%;
  }
  dt {
    font-size: 0.95rem;
    color: #555;
    margin-top: 16px;
    margin-bottom: 4px;
  }
  dd {
    font-size: 1rem;
    margin: 0;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0,0,0,0.08);
  }

  /* Liên kết dưới cùng */
  section.links {
    margin-top: 32px;
    display: flex;
    justify-content: center;
    gap: 24px;
  }
  a.external-link {
    font-size: 0.95rem;
    padding: 6px 10px;
  }
  svg.icon {
    width: 20px;
    height: 20px;
  }
}
