/* 

	Scott Horsfall & Kristen Dalin
	© 2025

*/

@import url(fonts.css);

:root {
  --background-rgb: 244, 240, 236;
  --background: rgb(var(--background-rgb));
  --background-elevated: #f9f7f5;

  --font-serif: "Editors Note", serif;
  --font-sans-serif: "Boathouse", -apple-system, BlinkMacSystemFont, sans-serif;

  --label-black: #23221e;
  --label-primary: #40382e;
  --label-secondary: #605952;
  --label-tertiary: #a5998d;
  --label-hover: #5e6c5b;

  --fill-primary: #e0d9d2;
  --fill-secondary: #ebe5e0;
  --fill-tertiary: rgb(var(--fill-tertiary-rgb));
  --fill-tertiary-rgb: 232, 227, 223;

  --text-title-extra-large: 84px;
  --text-title-large: 34px;
  --text-title-primary: 34px;
  --text-title-secondary: 26px;
  --text-title-tertiary: 22px;
  --text-body: 18px;
  --text-callout: 16px;
  --text-footnote: 14px;

  --text-weight-hairline: 100;
  --text-weight-thin: 200;
  --text-weight-extralight: 300;
  --text-weight-light: 400;
  --text-weight-regular: 500;
  --text-weight-medium: 600;

  --text-line-height-default: 1.4em;
  --text-line-height-tight: 1em;
  --text-line-height-loose: 1.5em;

  --size-1: 4px;
  --size-2: 8px;
  --size-3: 12px;
  --size-4: 16px;
  --size-5: 24px;
  --size-6: 32px;
  --size-7: 40px;
  --size-8: 48px;
  --size-9: 64px;
}

html,
body {
  background: var(--background);
  color: var(--label-primary);

  font-family: var(--font-serif);
  font-size: var(--text-callout);
  line-height: var(--text-line-height-loose);
  font-weight: var(--text-weight-regular);

  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;

  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
}

/*** text styles ***/

h1 {
  font-size: var(--text-title-extra-large);
  font-weight: var(--text-weight-extralight);
  line-height: var(--text-line-height-default);
  color: var(--label-primary);
}

h2 {
  font-size: var(--text-title-large);
  font-weight: var(--text-weight-thin);
  line-height: var(--text-line-height-default);
  color: var(--label-primary);
}

h3 {
  font-size: var(--text-title-secondary);
  font-weight: var(--text-weight-regular);
  line-height: var(--text-line-height-default);
  color: var(--label-primary);
}

h4 {
  font-size: var(--text-title-tertiary);
  font-weight: var(--text-weight-thin);
  line-height: var(--text-line-height-tight);
  color: var(--label-tertiary);
  text-transform: lowercase;
}

h5 {
  font-size: var(--text-body);
  font-weight: var(--text-weight-regular);
  color: var(--label-primary);
}

.sans-serif {
  font-family: var(--font-sans-serif);
  color: var(--label-secondary);
}

a {
  text-decoration: underline;
  text-decoration-thickness: 1pt;
  text-underline-offset: 2px;

  color: var(--label-black);
  text-decoration-color: var(--label-tertiary);
  font-weight: var(--text-weight-medium);

  -webkit-transition: all 50ms ease;
  -moz-transition: all 50ms ease;
  -ms-transition: all 50ms ease;
  -o-transition: all 50ms ease;
  transition: all 50ms ease;
}

a:hover {
  color: var(--label-secondary);
}

a.external::after {
  text-decoration: none;
  display: inline-block;

  content: "\2197";
  padding-left: var(--size-1);
  font-size: var(--text-footnote);
  color: var(--label-secondary-light);
}

/*** layout ***/

.content img {
  max-width: 368px;
}

main {
  height: 100%;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1;
  background: linear-gradient(
    to right,
    rgba(var(--background-rgb), 0) 0%,
    rgba(var(--background-rgb), 0.85) 25%,
    rgba(var(--background-rgb), 1) 35%
  );

  -webkit-animation: animatemain 1.4s normal both;
  animation: animatemain 1.4s normal both;
  -webkit-animation-delay: 0.2s;
  animation-delay: 0;
}

.save-the-date {
  width: 100%;
  height: 100%;
  position: absolute;
  left: -1.5vh;
  display: flex;
  flex-direction: column;
  align-items: start;
  justify-content: center;
  z-index: 0;
  -webkit-animation: fadeinsavethedate 1.4s normal both;
  animation: fadeinsavethedate 1.4s normal both;
  -webkit-animation-delay: 0.2s;
  animation-delay: 0.2s;
}

.save-the-date svg {
  height: 70vh;
  color: var(--fill-primary);
}

.content {
  height: 70vh;
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--size-2);
  position: relative;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--size-1);
  margin-bottom: var(--size-6);

  -webkit-animation: fadeAndScale 1s normal both;
  animation: fadeAndScale 1s normal both;
  -webkit-animation-delay: 0.4s;
  animation-delay: 0.4s;
}

.text-content {
  display: flex;
  flex-direction: column;
  gap: var(--size-1);
  margin-bottom: var(--size-6);
}

.buttons {
  display: flex;
  flex-direction: row;
  gap: var(--size-3);
}

.button {
  height: var(--size-7);
  padding: 0 var(--size-5);
  border-radius: var(--size-9);
  text-decoration: none;
  font-family: var(--font-sans-serif);
  font-size: var(--text-footnote);
  line-height: var(--text-line-height-tight);
  font-weight: var(--text-weight-medium);
  font-stretch: expanded;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--size-2);
  transition: background-color 0.15s ease-in-out;
}

.button span {
  margin-top: 2px;
}

.primary {
  background-color: var(--label-primary);
  color: var(--background);
}

.button.primary:hover {
  background-color: var(--label-black);
  color: var(--background);
}

.secondary {
  background-color: var(--fill-secondary);
  color: var(--label-secondary);
}

.secondary:hover {
  background-color: var(--fill-primary);
  color: var(--label-secondary);
}

.formal-invite {
  position: absolute;
  width: 100%;
  text-align: center;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);

  -webkit-animation: fadeIn 2s normal both;
  animation: fadeIn 2s normal both;
  -webkit-animation-delay: 0.6s;
  animation-delay: 0.6s;
}

/*** modal ***/

.modal {
  max-width: 600px;
  margin: 0 auto;
  position: fixed;
  background: var(--background-elevated);
  opacity: 0;
  pointer-events: none;
  z-index: 1000;
  box-shadow: 0 0 0px 1px var(--fill-tertiary);
  visibility: hidden;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(var(--fill-tertiary-rgb), 0.5);
  backdrop-filter: blur(12px);
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  pointer-events: none;
  z-index: 999;
}

.modal-content {
  padding: var(--size-4) var(--size-4) var(--size-6) var(--size-5);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: start;
  gap: var(--size-5);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease-in-out;
}

.modal-header.scrolled {
  border-color: var(--fill-secondary);
}

.close-button {
  border-radius: 50%;
  padding: var(--size-4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  transition: background-color 0.15s ease-in-out;
}

.close-button:hover {
  background-color: var(--fill-tertiary);
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-body {
  display: flex;
  flex-direction: column;
  justify-content: start;
  align-items: start;
  gap: var(--size-5);
  padding-right: var(--size-4);
  font-size: var(--text-callout);
  font-family: var(--font-sans-serif);
  line-height: var(--text-line-height-loose);
  color: var(--label-secondary);
}

.modal-body b {
  display: inline-block;
  font-weight: var(--text-weight-medium);
  color: var(--label-primary);
}

.modal-section {
  display: flex;
  flex-direction: column;
  gap: var(--size-2);
}

.callout {
  background-color: rgba(var(--fill-tertiary-rgb), 0.5);
  padding: var(--size-3) var(--size-3);
  border-radius: var(--size-2);
  margin: 0 calc(var(--size-4) * -1) 0 calc(var(--size-3) * -1);
}

.fine-print {
  color: var(--label-tertiary);
  font-size: var(--text-footnote);
  line-height: var(--text-line-height-default);
}

/*** animations ***/

@keyframes fadeinsavethedate {
  0% {
    opacity: 0;
    left: -5vh;
  }
  100% {
    opacity: 1;
    left: -1.5vh;
  }
}

@keyframes fadeinsavethedate-mobile {
  0% {
    opacity: 0;
    top: -2vh;
  }
  100% {
    opacity: 1;
    top: 0;
  }
}

@keyframes fadeAndScale {
  0% {
    opacity: 0;
    scale: 0.95;
  }
  100% {
    opacity: 1;
    scale: 1;
  }
}

@keyframes fadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@media (min-width: 853px) {
  .modal {
    margin: auto;
    left: var(--size-3);
    right: var(--size-3);
    border-radius: var(--size-6);
    top: 50%;
    transform: translateY(-50%);
    scale: 0.95;
    transition: opacity 0.2s ease-in-out, scale 0.2s ease-in-out;
  }

  .modal.show {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    scale: 1;
  }

  .save-the-date-mobile {
    display: none;
  }
}

@media (max-width: 852px) {
  :root {
    --text-title-extra-large: 48px;
    --text-title-large: 24px;
    --text-title-secondary: 22px;
    --text-title-tertiary: 20px;
    --text-body: 20px;
    --text-callout: 17px;
    --text-footnote: 15px;
  }

  main {
    background: linear-gradient(
      to bottom,
      rgba(var(--background-rgb), 0) 25%,
      rgba(var(--background-rgb), 0.85) 35%
    );
  }

  h1 {
    font-weight: var(--text-weight-light);
  }

  h2 {
    font-weight: var(--text-weight-extralight);
  }

  h4 {
    font-weight: var(--text-weight-extralight);
  }

  h5 {
    font-weight: var(--text-weight-light);
  }

  .save-the-date {
    display: none;
  }

  .save-the-date-mobile {
    display: block;
    font-size: var(--text-title-large);
    font-weight: var(--text-weight-light);
    line-height: var(--text-line-height-default);
    color: var(--label-tertiary);

    -webkit-animation: fadeinsavethedate-mobile 1.4s normal both;
    animation: fadeinsavethedate-mobile 1.4s normal both;
    -webkit-animation-delay: 0.2s;
    animation-delay: 0.2s;
  }

  .content {
    height: 100%;
    padding-top: var(--size-4);
    padding-bottom: var(--size-4);
    justify-content: flex-start;
  }

  .content img {
    max-width: 256px;
  }

  .buttons {
    align-items: center;
    flex-direction: column;
    gap: var(--size-2);
  }

  .button {
    height: 44px;
    padding: 0 var(--size-5);
  }

  .save-the-date {
    justify-content: start;
    left: -0.5vh;
  }

  .save-the-date svg {
    height: 20vh;
  }

  .modal {
    bottom: 0;
    left: 0;
    right: 0;
    transform: translateY(100%);
    border-radius: var(--size-6) var(--size-6) 0 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
  }

  .modal.show {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
    transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
  }

  .modal-content {
    padding-top: var(--size-4);
    padding-bottom: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .modal-header {
    padding-bottom: calc(var(--size-4) + var(--size-1));
  }

  .modal-body {
    padding-top: var(--size-3);
    padding-bottom: var(--size-5);
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
  }

  .close-button {
    background-color: var(--fill-secondary);
  }

  .close-button:hover {
    background-color: var(--fill-primary);
  }

  @keyframes fadeinsavethedate {
    0% {
      opacity: 0;
      left: -2.5vh;
    }
    100% {
      opacity: 1;
      left: -0.5vh;
    }
  }

  .hero {
    margin-top: auto;
    margin-bottom: var(--size-4);
  }

  .formal-invite {
    position: static;
    transform: none;
    margin-top: auto;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --background-rgb: 32, 31, 29;
    --background: rgb(32, 31, 29);
    --background-elevated: hsl(45, 5%, 15%);

    --label-black: #fcfaf8;
    --label-primary: hsl(28, 30%, 92%);
    --label-secondary: hsl(27, 13%, 65%);
    --label-tertiary: hsl(27, 10%, 50%);

    --fill-primary: rgb(55, 52, 47);
    --fill-secondary: hsl(33, 10%, 25%);
    --fill-tertiary: rgb(var(--fill-tertiary-rgb));
    --fill-tertiary-rgb: 56, 52, 46;
  }

  .modal {
    box-shadow: 0 0 0px 1px rgba(255, 255, 255, 0.075);
  }

  .content img {
    filter: invert(0.8) sepia(0.3) brightness(0.95) opacity(0.8);
  }
}
