/* Personal Website v1.1 enhancement layer.
   Loaded after the validated v1.0 stylesheet so changes remain easy to audit/revert. */

html { scroll-padding-top: 96px; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
#main-content:focus { outline: none; }

.skip-link {
  position: fixed;
  z-index: 999;
  top: 10px;
  left: 12px;
  transform: translateY(-160%);
  padding: 10px 14px;
  border-radius: 10px;
  background: #fff;
  color: var(--navy);
  border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(11,32,48,.16);
  font-weight: 800;
  text-decoration: none;
}
.skip-link:focus { transform: translateY(0); }

nav a { position: relative; }
nav a:not(.nav-cta)::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -8px;
  height: 2px;
  border-radius: 999px;
  background: var(--teal);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .18s ease;
}
nav a:not(.nav-cta):hover::after,
nav a.nav-active:not(.nav-cta)::after { transform: scaleX(1); }
nav a.nav-active:not(.nav-cta) { color: var(--navy); }
.nav-cta.nav-active { background: var(--teal); box-shadow: 0 0 0 3px rgba(11,117,97,.13); }

.page > h1 { max-width: 900px; }
.page-about > .content .page > h1 + p,
.page-research > .content .page > h1 + p,
.page-projects > .content .page > h1 + p,
.page-publications > .content .page > h1 + p,
.page-contact > .content .page > h1 + p {
  max-width: 880px;
  margin-top: 1.1rem;
  color: #314b5b;
  font-size: clamp(1.08rem,1.45vw,1.22rem);
  line-height: 1.75;
}

.page h2 {
  scroll-margin-top: 105px;
  padding-top: .25rem;
}
.page h2::after {
  content: "";
  display: block;
  width: 46px;
  height: 3px;
  margin-top: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg,var(--teal),rgba(21,86,121,.45));
}
.page h3 { scroll-margin-top: 105px; }
.page li { margin: .22rem 0; }
.page > ol, .page > ul { padding-left: 1.35rem; }
.page code { font-size: .92em; }

.page-about .timeline-item,
.page-cv .timeline-item { padding-top: 2px; padding-bottom: 2px; }
.page-about .timeline-item p,
.page-cv .timeline-item p { max-width: 880px; }

.page-research .metric-card,
.page-about .metric-card {
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.page-research .metric-card:hover,
.page-about .metric-card:hover {
  transform: translateY(-2px);
  border-color: #bdd5d0;
  box-shadow: 0 12px 28px rgba(16,35,49,.07);
}

.page-projects .page h3,
.page-publications .page h3 {
  margin-top: 2.1rem;
  padding: 15px 17px;
  border-left: 3px solid var(--teal);
  border-radius: 0 12px 12px 0;
  background: linear-gradient(90deg,rgba(223,241,236,.62),rgba(255,255,255,0));
}
.page-projects .page h3 + p,
.page-publications .page h3 + p { margin-top: 1rem; }
.page-projects .notice,
.page-publications .notice { margin: 2rem 0; }

.page-contact .page h2 { margin-top: 2rem; }
.page-contact .page ul { max-width: 850px; }
.page-contact .page strong { color: var(--navy); }

.domain-card, .system-card, .repo-card, .role-card {
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.domain-card:hover, .system-card:hover, .repo-card:hover, .role-card:hover {
  transform: translateY(-3px);
  border-color: #c4d9d5;
  box-shadow: 0 14px 34px rgba(16,35,49,.075);
}
.repo-card a {
  margin-right: 8px;
  padding-bottom: 1px;
  text-decoration-thickness: 1px;
}
.section-shell > p:last-child a {
  display: inline-flex;
  align-items: center;
  margin-top: 14px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  text-decoration: none;
}
.section-shell > p:last-child a:hover { border-color: #b8d4cd; background: #f5faf8; }

.notice { line-height: 1.65; }
.footer-meta { margin-top: 5px; font-size: .82rem; color: #7a8992; }

@media (max-width: 820px) {
  .brand { font-size: 1rem; }
  .brand-mark { flex: 0 0 auto; }
  .page { padding: 34px 26px; }
  .page-projects .page h3,
  .page-publications .page h3 { padding: 12px 14px; }
}

@media (max-width: 560px) {
  .stat-strip { grid-template-columns: 1fr; }
  .stat { border-right: 0; border-bottom: 1px solid var(--line); }
  .stat:last-child { border-bottom: 0; }
  .brand span:last-child { max-width: 230px; line-height: 1.15; }
  nav { width: 100%; }
  nav a { font-size: .86rem; }
  .page { padding: 28px 20px; }
  .page h2::after { width: 36px; }
  .profile-top { align-items: flex-start; }
  .profile-photo { width: 70px; height: 70px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media print {
  @page { margin: 14mm; }
  body { background: #fff !important; color: #000; font-size: 10.5pt; }
  .site-header, .site-footer, .skip-link { display: none !important; }
  .wrap, .content { width: 100% !important; max-width: none !important; margin: 0 !important; padding: 0 !important; }
  .page { border: 0 !important; box-shadow: none !important; background: #fff !important; padding: 0 !important; }
  .page h1 { font-size: 26pt; }
  .page h2 { font-size: 16pt; margin-top: 18pt; break-after: avoid; }
  .page h3 { font-size: 12pt; break-after: avoid; }
  .page h2::after { display: none; }
  .timeline-item, .metric-card, .notice { break-inside: avoid; }
  .tag { border-color: #bbb; background: #fff; }
  a { color: #000 !important; text-decoration: none; }
  .page-cv .notice:last-child { display: none; }
}
