/* Home page — static portfolio layout */

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

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button {
  font: inherit;
}

.wrap {
  width: min(var(--content-width), calc(100% - 48px));
  margin-inline: auto;
}

:where(a, button, [tabindex]):focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

main:focus {
  outline: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 10;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--color-accent);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 16px;
}

/* Header */

.site-header {
  position: relative;
  z-index: 10;
  background: var(--color-bg);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  min-height: 80px;
}

.brand {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 800;
  font-size: 22px;
  line-height: 38px;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 40px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border: 0;
  border-radius: 12px;
  background: var(--color-accent);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.btn:hover {
  background: color-mix(in srgb, var(--color-accent) 85%, #000);
}

.btn--header {
  min-width: 208px;
  padding: 10px 16px;
  border-radius: 8px;
}

/* Biography */

.bio {
  padding-block: 104px;
}

.bio__lede {
  margin: 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: 40px;
  line-height: 44px;
  color: var(--color-accent);
}

.bio__copy {
  margin-top: 24px;
  font-size: 24px;
  line-height: 1.21;
}

.bio__copy p {
  margin: 0;
}

.bio__copy p + p {
  margin-top: 16px;
}

.bio__copy strong {
  font-weight: 600;
}

/* Projects */

.section-title {
  margin-block: 0;
  padding-top: 72px;
  padding-bottom: 7px;
  font-size: 40px;
  font-weight: 700;
  line-height: 38px;
}

.project {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding-block: 56px;
}

.project__media {
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}

.project__media-track {
  display: flex;
  align-items: center;
  gap: 24px;
  width: max-content;
  margin-inline: auto;
}

.project__phone {
  flex: 0 0 auto;
  width: 300px;
  max-width: none;
  height: 637px;
  object-fit: cover;
  scroll-snap-align: start;
}

.project__phone--wide {
  width: 303px;
}

.project__laptop {
  width: 100%;
  height: auto;
}

.project__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

.project__heading {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.project__title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.project__title {
  margin: 0;
  font-size: 25px;
  font-weight: 700;
  line-height: 38px;
}

.project__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0 16px;
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  line-height: 38px;
}

.project__desc {
  margin: 0;
  font-size: 20px;
  font-weight: 500;
  line-height: 38px;
}

.project__status {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0;
  margin-left: 24px;
  font-size: 25px;
  font-weight: 700;
  line-height: 38px;
}

.project__status img {
  flex: 0 0 auto;
}

/* Footer */

.site-footer {
  background: var(--color-bg);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  min-height: 80px;
}

.site-footer__contact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 24px;
  font-size: 16px;
  font-weight: 500;
  line-height: 38px;
}

.site-footer__contact span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-footer__contact a {
  text-decoration: none;
}

.site-footer__contact a:hover,
.site-footer__contact a[target="_blank"] {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Contact popover */

.site-nav__action {
  position: relative;
}

.contact-dialog {
  position: absolute;
  inset: 0 auto auto 0;
  margin: 0;
  width: 360px;
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 32px);
  padding: 16px;
  border: 0;
  border-radius: 8px;
  background: var(--color-bg);
  color: var(--color-ink);
  box-shadow: 0 4px 4px 4px rgb(0 0 0 / 0.25);
  overflow: auto;
}

.contact-dialog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.contact-dialog__title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  line-height: 38px;
  color: var(--color-accent);
}

.contact-dialog__close {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: none;
  cursor: pointer;
}

.contact-dialog__close:hover {
  background: rgb(49 86 78 / 0.1);
}

.contact-dialog__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
  font-size: 16px;
  font-weight: 500;
  line-height: 38px;
}

.contact-dialog__list li {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Feather (MIT) stroke icons, 24px grid scaled down */
.contact-dialog__list svg,
.site-footer__contact svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.contact-dialog__list a {
  text-decoration: none;
}

.contact-dialog__list a:hover,
.contact-dialog__list a[target="_blank"] {
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 768px) {
  /* Keep the popover inside the viewport where the trigger sits near the right edge */
  .contact-dialog {
    inset: 0 0 auto auto;
  }
}

/* Responsive */

@media (max-width: 768px) {
  .bio {
    padding-block: 80px;
  }

  .bio__copy {
    font-size: 22px;
    line-height: 1.35;
  }

  .section-title {
    padding-top: 56px;
  }

  .project {
    padding-block: 48px;
  }

  .project__desc {
    font-size: 19px;
    line-height: 34px;
  }

  .site-footer__inner {
    padding-block: 16px;
  }
}

@media (max-width: 480px) {
  .wrap {
    width: calc(100% - 40px);
  }

  .site-header__inner {
    flex-wrap: wrap;
    gap: 12px 16px;
    padding-block: 14px;
    min-height: 0;
  }

  .site-nav {
    margin-left: auto;
    gap: 16px;
  }

  .btn--header {
    min-width: 0;
    padding: 8px 12px;
    font-size: 16px;
  }

  .brand {
    font-size: 20px;
  }

  .bio {
    padding-block: 56px;
  }

  .bio__lede {
    font-size: 30px;
    line-height: 36px;
  }

  .bio__copy {
    margin-top: 20px;
    font-size: 19px;
    line-height: 1.55;
  }

  .section-title {
    padding-top: 40px;
    font-size: 30px;
    line-height: 34px;
  }

  .project {
    gap: 24px;
    padding-block: 36px;
  }

  .project__title {
    font-size: 22px;
    line-height: 30px;
  }

  .project__title-row {
    gap: 8px;
  }

  .project__tags {
    gap: 0 12px;
    font-size: 17px;
    line-height: 30px;
  }

  .project__desc {
    font-size: 18px;
    line-height: 1.6;
  }

  .project__status {
    gap: 6px;
    margin-left: 0;
    font-size: 18px;
    line-height: 30px;
  }

  .project__status img {
    width: 20px;
    height: 20px;
  }

  .project__status span {
    white-space: nowrap;
  }

  .site-footer__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding-block: 24px;
  }

  .site-footer__contact {
    flex-direction: column;
    align-items: flex-start;
  }
}
