/* Shared responsive enhancements for the site and standalone pages. */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

img {
  max-width: 100%;
  height: auto;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid #fff498;
  outline-offset: 3px;
}

/* Content pages: comfortable reading width and touch-friendly controls. */
.my_story-content,
.physics-content,
.vision-content,
.research-content,
.ai_research-content,
.book_reviews-content {
  width: min(100%, 800px);
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 32px);
}

.card-container {
  gap: clamp(16px, 3vw, 24px);
}

.card {
  width: min(100%, 280px);
}

.card-link,
.back-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 767px) {
  body {
    font-size: 14px;
    line-height: 1.5;
  }

  /* Do not replace the site with a desktop-only warning on phones. */
  .device-notification {
    display: none !important;
  }

  .header {
    position: relative;
    height: auto;
    min-height: 64px;
    padding: 12px 16px !important;
  }

  .header--logo {
    min-width: 0;
  }

  .header--logo img {
    flex: 0 0 auto;
  }

  .header--logo p {
    margin-left: 10px;
    font-size: clamp(12px, 3.7vw, 16px);
    line-height: 1.25;
    overflow-wrap: anywhere;
  }

  .my_story-content,
  .physics-content,
  .vision-content,
  .research-content,
  .ai_research-content,
  .book_reviews-content {
    padding-top: 24px !important;
    padding-bottom: 32px !important;
  }

  .my_story-content h1,
  .physics-content h1,
  .vision-content h1,
  .research-content h1,
  .ai_research-content h1,
  .book_reviews-content h1 {
    font-size: clamp(1.8rem, 8vw, 2.3rem) !important;
    line-height: 1.15;
    overflow-wrap: anywhere;
  }

  .my_story-content p,
  .physics-content p,
  .vision-content p,
  .research-content p,
  .ai_research-content p,
  .book_reviews-content > p {
    font-size: 1rem !important;
    line-height: 1.65 !important;
  }

  .card-container {
    margin-top: 20px;
  }

  .card {
    width: min(100%, 360px) !important;
  }

  .card-body {
    padding: 16px !important;
  }

  .card-link,
  .back-button {
    width: 100% !important;
    max-width: 360px;
    padding: 10px 16px !important;
    font-size: 1rem !important;
  }

  /* The original home page is a fixed-height desktop presentation. Make it
     a readable, scrollable sequence on phones instead. */
  .l-viewport {
    height: auto;
    min-height: 100svh;
    overflow: visible;
  }

  .l-wrapper {
    width: 100%;
    max-width: none;
    height: auto;
    padding-inline: 16px;
  }

  .l-main-content {
    height: auto;
  }

  .l-section {
    position: relative;
    min-height: auto;
    height: auto;
    padding-block: 32px;
    opacity: 1;
    visibility: visible;
    transform: none !important;
  }

  .intro,
  .work,
  .about,
  .contact--lockup,
  .hire {
    width: 100%;
    max-width: none;
    height: auto;
    min-height: 0;
  }

  .intro--banner,
  .about--banner {
    height: auto;
    min-height: 0;
  }

  .intro--banner h1,
  .about--banner h2 {
    margin-top: 0;
    font-size: clamp(2.5rem, 13vw, 4rem);
  }

  .intro--banner img {
    position: relative;
    right: auto;
    bottom: auto;
    display: block;
    width: min(100%, 320px) !important;
    max-width: 320px !important;
    margin: 24px auto 0;
  }

  .intro--options,
  .about--options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .intro--options > a,
  .about--options > a {
    width: 100%;
    max-width: none;
    margin: 0;
  }

  .about--options > a {
    height: 96px;
  }

  .about--options h3 {
    bottom: -34px;
  }

  .work--lockup .slider {
    width: 100%;
  }

  .work--lockup .slider--item-center {
    left: 50%;
  }

  .work--lockup .slider--item-center .slider--item-image {
    width: min(55vw, 220px);
    height: min(55vw, 220px);
  }

  .work--lockup .slider--next,
  .work--lockup .slider--prev {
    top: min(28vw, 110px);
    width: 44px;
    height: 44px;
  }

  .contact {
    position: relative;
    min-height: 0;
  }

  .contact--lockup {
    padding: 0;
  }

  .contact--lockup .modal {
    width: 100%;
    padding: 28px 20px;
  }

  .header--cta {
    position: static;
    transform: none;
    margin-left: auto;
    opacity: 1;
    visibility: visible;
  }

  .header--nav-toggle,
  .l-side-nav {
    display: none;
  }
}

@media (max-width: 420px) {
  .l-wrapper {
    padding-inline: 12px;
  }

  .intro--banner h1,
  .about--banner h2 {
    font-size: 2.35rem;
  }

  .work--lockup .slider--next,
  .work--lockup .slider--prev {
    width: 38px;
    height: 38px;
  }
}
