/* The Summit Collection — single-page site.
   Fonts are self-hosted (SIL Open Font License; notices in assets/fonts/). */

@font-face {
  font-family: "Cormorant Garamond";
  src: url("assets/fonts/cormorant-garamond-latin-wght-normal.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "DM Sans";
  src: url("assets/fonts/dm-sans-latin-opsz-wght-normal.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --black: #000000;
  --white: #ffffff;
  --gold: #c19435;
  --soft: rgba(255, 255, 255, 0.68);
  --serif: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "DM Sans", "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(1.25rem, 0.4rem + 3.6vw, 4.5rem);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  background: var(--black);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--black);
  color: var(--white);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

h1,
h2,
p,
dl,
dd,
ul {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

::selection {
  background: var(--gold);
  color: var(--black);
}

:focus-visible {
  outline: 1px solid var(--gold);
  outline-offset: 4px;
}

.visually-hidden {
  position: absolute !important;
  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: 0.75rem;
  left: 0.75rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  background: var(--gold);
  color: var(--black);
  font-size: 0.875rem;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* ---------- Page layout ---------- */

/* Six rows: space, logo, statement, space, contact, footer. The two flexible rows
   share the free height, so the logo and statement sit centred above the contact
   row, which stays low on the page just above the footer. Both flexible rows have
   a minimum, so at short heights the page simply grows and nothing overlaps. */
.page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows:
    minmax(clamp(2rem, 6vh, 4rem), 1fr)
    auto
    auto
    minmax(clamp(2.5rem, 7vh, 5rem), 1fr)
    auto
    auto;
  min-height: 100vh;
  min-height: 100svh;
}

/* ---------- Masthead ---------- */

.masthead {
  grid-row: 2;
  display: flex;
  justify-content: center;
  padding: 0 var(--gutter);
}

.brand {
  width: min(100%, 115vh, 62rem);
  font-size: 1rem;
  line-height: 0;
}

.logo {
  width: 100%;
}

/* ---------- Statement ---------- */

.main {
  grid-row: 3 / 6;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: subgrid;
}

.hero {
  grid-row: 1;
  margin-top: clamp(2rem, 6.5vh, 5rem);
  padding: 0 var(--gutter);
  text-align: center;
}

/* Set as a three-line stanza: the second clause balances over two lines. */
.hero-heading {
  max-width: 18em;
  margin: 0 auto;
  font-family: var(--serif);
  font-size: clamp(1.75rem, min(1rem + 2.6vw, 6vh), 5.5rem);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.008em;
}

.hero-line {
  display: block;
}

.hero-line > span {
  display: inline-block;
  text-wrap: balance;
}

.invitation {
  margin-top: clamp(1rem, 2.8vh, 1.75rem);
  color: var(--gold);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  line-height: 1.8;
  text-transform: uppercase;
  text-wrap: balance;
}

/* ---------- Contact ---------- */

/* Low on the page, just above the footer: email at the left edge and telephone
   at the right edge of the same 84rem measure as the footer. */
.connect {
  grid-row: 3;
  display: grid;
  grid-template-columns: auto auto;
  justify-content: space-between;
  align-items: end;
  column-gap: 2rem;
  width: min(100%, 84rem);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Label above, detail below. */
.contact-item {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.contact-item--email {
  grid-column: 1;
  grid-row: 1;
  align-items: flex-start;
  text-align: left;
}

.contact-item--tel {
  grid-column: 2;
  grid-row: 1;
  align-items: flex-end;
  text-align: right;
}

.contact-label {
  display: flex;
  align-items: center;
  min-height: 1.75rem;
  color: var(--gold);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--white);
  font-family: var(--serif);
  font-size: clamp(1.3rem, 1.1rem + 0.5vw, 1.6rem);
  font-weight: 500;
  font-variant-numeric: lining-nums;
  text-decoration: none;
  background-image: linear-gradient(var(--gold), var(--gold));
  background-repeat: no-repeat;
  background-position: 0 calc(100% - 0.4rem);
  background-size: 0 1px;
  transition: background-size 720ms var(--ease);
  overflow-wrap: anywhere;
}

.contact-link:hover,
.contact-link:focus-visible {
  background-size: 100% 1px;
}

/* ---------- Footer ---------- */

.footer {
  grid-row: 6;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 2rem;
  width: min(100% - 2 * var(--gutter), 84rem - 2 * var(--gutter));
  margin: clamp(0.85rem, 2.2vh, 1.5rem) auto 0;
  padding: 0.35rem 0 0.6rem;
  color: var(--soft);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.75rem;
}

.footer-button {
  min-height: 2.75rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--soft);
  font: inherit;
  letter-spacing: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 0.35em;
  transition: color 400ms var(--ease), text-decoration-color 400ms var(--ease);
}

.footer-button:hover,
.footer-button:focus-visible {
  color: var(--white);
  text-decoration-color: var(--gold);
}

/* ---------- Dialogs ---------- */

.dialog {
  width: min(calc(100% - 2rem), 32rem);
  max-height: calc(100% - 2rem);
  padding: 0;
  border: 1px solid var(--gold);
  background: var(--black);
  color: var(--white);
}

.dialog::backdrop {
  background: rgba(0, 0, 0, 0.74);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.dialog-inner {
  padding: clamp(1.5rem, 1rem + 2vw, 2.5rem);
}

.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.dialog-title {
  font-family: var(--serif);
  font-size: 1.85rem;
  font-weight: 500;
  line-height: 1.15;
}

.dialog-close {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  margin: -0.5rem -0.75rem 0 0;
  padding: 0;
  border: 1px solid transparent;
  background: none;
  color: var(--white);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 400ms var(--ease), color 400ms var(--ease);
}

.dialog-close:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.rule {
  display: block;
  width: 3.5rem;
  height: 1px;
  margin: 1.25rem 0 1.5rem;
  background: var(--gold);
}

.dialog-list {
  display: grid;
  gap: 0.9rem;
  margin-bottom: 1.5rem;
}

.dialog-list dt {
  color: var(--gold);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.dialog-list dd {
  font-size: 0.975rem;
}

.dialog-text {
  color: var(--soft);
  font-size: 0.975rem;
  line-height: 1.7;
}

.dialog-text + .dialog-text {
  margin-top: 0.9rem;
}

.text-link {
  color: var(--white);
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
  overflow-wrap: anywhere;
}

.text-link:hover,
.text-link:focus-visible {
  color: var(--gold);
}

/* ---------- Large displays: the whole composition scales together ---------- */

@media (min-width: 1800px) and (min-height: 980px) {
  html {
    font-size: 112.5%;
  }
}

@media (min-width: 2300px) and (min-height: 1260px) {
  html {
    font-size: 137.5%;
  }
}

/* ---------- Phones ---------- */

/* Both contacts centred and stacked near the bottom, in normal flow. */
@media (max-width: 599px) {
  .connect {
    grid-template-columns: minmax(0, 1fr);
    justify-content: stretch;
    justify-items: center;
    row-gap: 0.75rem;
  }

  .contact-item--email,
  .contact-item--tel {
    grid-column: 1;
    align-items: center;
    text-align: center;
  }

  .contact-item--tel {
    grid-row: 2;
  }

  .footer {
    flex-direction: column;
    text-align: center;
    padding-top: 0.75rem;
  }

  .footer-links {
    justify-content: center;
  }
}

/* ---------- Opening sequence ----------
   Every duration and every stagger delay is twice the version 2 value, so the
   whole opening ends at 5.50s (footer 3.1s + 2.4s) = 2 x 2.75s. */

@media (prefers-reduced-motion: no-preference) {
  .brand {
    animation: settle 3.2s var(--ease-out) 0.3s both;
  }

  .hero-line {
    overflow: hidden;
    padding-bottom: 0.14em;
    margin-bottom: -0.14em;
  }

  .hero-line > span {
    animation: line-up 2.6s var(--ease-out) both;
  }

  .hero-line:nth-child(1) > span {
    animation-delay: 1.2s;
  }

  .hero-line:nth-child(2) > span {
    animation-delay: 1.5s;
  }

  .invitation,
  .connect,
  .footer {
    animation: fade 2.4s ease-out both;
  }

  .invitation {
    animation-delay: 2.3s;
  }

  .connect {
    animation-delay: 2.7s;
  }

  .footer {
    animation-delay: 3.1s;
  }

  .dialog[open] {
    animation: settle 640ms var(--ease-out);
  }

  @keyframes settle {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }

  @keyframes line-up {
    from {
      opacity: 0;
      transform: translateY(105%);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }

  @keyframes fade {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }
}
