/* Colors come from the photo: his navy shirt and the warm wall. */
:root {
  --cream: #FBF6EF;
  --navy: #1F2A44;
  --navy-hover: #2D3C5F;
  --serif: ui-serif, "New York", "Iowan Old Style", Charter, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

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

/* svh is the height left while the browser's toolbars show, so fits hold on real phones. */
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  background: var(--cream);
  color: var(--navy);
  font: 1rem/1.5 var(--sans);
}

/* Base: one column for upright phones, tablets and laptops. */
.page {
  width: 100%;
  max-width: 34rem;
  padding: 1.25rem;
}

/* Capped at 35% of the screen's height; a capped photo crops evenly top and bottom. */
.photo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  max-height: 35vh;
  max-height: 35svh;
  object-fit: cover;
  border-radius: 1rem;
}

/* 1.45rem keeps the heading on one line across the full column in every serif above. */
h1 {
  margin: 1rem 0 0;
  font: 600 1.45rem/1.2 var(--serif);
}

.note {
  margin: 0.75rem 0 0;
  text-wrap: pretty;
}

.registries {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  background: var(--navy);
  color: var(--cream);
  font-weight: 600;
  text-decoration: none;
}

.button:hover {
  background: var(--navy-hover);
}

.button:focus-visible {
  outline: 3px solid var(--navy);
  outline-offset: 3px;
}

/* Phones held sideways: photo on the left, words and buttons on the right. */
@media (orientation: landscape) and (max-height: 32rem) {
  .page {
    max-width: 56rem;
    padding: 1rem 1.25rem;
    display: grid;
    /* The photo keeps 4:3 at the screen's height, but never takes more than half the row. */
    grid-template-columns: min(calc((100vh - 2rem) * 4 / 3), calc((100% - 1.5rem) / 2)) 1fr;
    grid-template-columns: min(calc((100svh - 2rem) * 4 / 3), calc((100% - 1.5rem) / 2)) 1fr;
    gap: 1.5rem;
    align-items: center;
  }

  .photo {
    height: calc(100vh - 2rem);
    height: calc(100svh - 2rem);
    max-height: none;
    aspect-ratio: auto;
  }

  h1 {
    margin-top: 0;
    font-size: 1.4rem;
  }

  .registries {
    grid-template-columns: 1fr 1fr;
  }
}
