@import url("/tokens.css");

html {
  scroll-behavior: smooth;
}

h2 {
  margin-top: 24px;
}

body {
  background: var(--bg);
  background-attachment: fixed;
  background-image: linear-gradient(135deg, #fbf4e8 0%, #f7f4ed 52%, #eef2ef 100%);
  padding-top: 0;
  padding-bottom: 1em;
}

/* Skip navigation link for screen readers */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #0069ff;
  color: white;
  padding: 8px 16px;
  text-decoration: none;
  font-weight: 600;
  border-radius: 0 0 4px 0;
  z-index: 100;
}

.skip-link:focus {
  top: 0;
}

.clearfix::after {
  content: "";
  clear: both;
  display: table;
}

article {
  background: none;
  border: none;
  padding-bottom: 0px;
  padding-top: 0px;
}

nav ul {
  text-align: left;
}

footer {
  margin-top: 3em;
  padding-top: 1em;
  padding-bottom: 1em;
  border-top: 1px solid #ccc;
}

footer .nav--links {
  padding-left: 0;
  text-align: center;
}

footer .nav--links li {
  margin: 0;
}

footer .nav--links span {
  display: inline-block;
  margin: 0 0.65em;
}

.icon {
  max-width: 24px;
}

.photo__block {
  grid-row: 1 / span 2;
  margin-top: 0;
  margin-right: 0;
}

.photo__block a {
  position: relative;
  display: block;
  width: 128px;
  height: 128px;
  overflow: hidden;
  border-radius: 50%;
}

.photo__block picture {
  display: block;
}

.photo__block .photo__wink {
  position: absolute;
  inset: 0;
}

header {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 40px;
  margin-top: 72px;
  padding-top: 0;
  padding-left: 40px;
  padding-bottom: 10px;
}

header h1 {
  grid-column: 2;
  align-self: end;
  margin: 0 0 9px;
}

header p {
  grid-column: 2;
  align-self: start;
  margin: 0;
}

nav.nav--links ul li {
  display: inline-block;
  margin-right: 1.5em;
}

nav.nav--links ul li:last-child {
  margin-right: 0;
}

a {
  transition: color 0.3s ease, outline 0.2s ease;
}

a:hover {
  color: #0069ff;
}

/* Focus styles for keyboard navigation */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
  outline: 3px solid #0069ff;
  outline-offset: 2px;
}

a:focus:not(:focus-visible) {
  outline: none;
}

a:focus-visible {
  outline: 3px solid #0069ff;
  outline-offset: 2px;
  border-radius: 2px;
}

/* External link indicator */
a[target="_blank"]:not(.skip-link)::after {
  content: " ↗";
  font-size: 0.8em;
  opacity: 0.7;
}

.highlight {
  font-weight: 600;
  opacity: 0.8;
}

section {
  max-width: 640px;
}

.photo__block img {
  width: 128px;
  height: 128px;
  max-height: none;
  border-radius: 0;
  object-fit: cover;
  object-position: center top;
  transform: translateY(10px) scale(1.28);
  transition: transform 0.35s ease, opacity 0.12s ease;
}

.photo__block .photo__wink img {
  opacity: 0;
}

@keyframes portrait-wink-frame {
  0%, 12%, 62%, 100% { opacity: 0; }
  26%, 44% { opacity: 1; }
}

@media (hover: hover) and (pointer: fine) {
  .photo__block a:hover img,
  .photo__block a:focus-visible img {
    transform: translateY(16px) scale(1.42);
  }

  .photo__block a:hover .photo__wink img {
    animation: portrait-wink-frame 0.5s ease-in-out 0.03s 1;
  }
}

@media screen and (max-width: 467px) {
  .photo__block {
    float: none;
    margin: 0 0 30px 0;
  }

  .photo__block img {
    margin: 0;
  }

  header {
    display: block;
    margin-top: 0;
    padding: 18px;
  }

  h1 {
    margin: 1em 0 0.5em;
    font-size: 32px;
  }

  p {
    margin-bottom: 0.5em;
  }

  nav ul.nav--links li {
    display: block;
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 0.5em;
  }

  footer {
    padding: 1.5em 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .photo__block img {
    transition: none;
  }

  .photo__block a:hover .photo__wink img {
    animation: none;
  }
}

/* Print styles */
@media print {
  body {
    background: white;
    background-image: none;
    color: black;
  }

  .skip-link,
  nav,
  footer nav {
    display: none;
  }

  header {
    padding-left: 0;
  }

  .photo__block {
    float: left;
    margin-right: 20px;
    margin-top: 0;
  }

  .photo__block img {
    max-height: 120px;
  }

  a {
    color: black;
    text-decoration: underline;
  }

  a::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    word-break: break-all;
  }

  a[href^="mailto:"]::after,
  a[href^="#"]::after {
    content: "";
  }

  section {
    max-width: 100%;
  }

}
