:root {
  color-scheme: light;
  --ink: #f1d39a;
  --paper: #731f1c;
  --font-sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-sans);
}

.title-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: calc(100vh - 40px);
  min-height: calc(100svh - 40px);
  padding: clamp(28px, 4vw, 64px);
  align-items: end;
  gap: 48px;
}

.photo-section {
  width: 100%;
  overflow: hidden;
  background: #241715;
}

.photo-section img {
  display: block;
  width: 100%;
  height: auto;
  animation: portrait-reveal 900ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

h1,
.date-link {
  margin: 0;
  font-weight: 400;
  letter-spacing: 0;
}

h1 {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  font-size: clamp(4.5rem, 10.8vw, 11rem);
  line-height: 0.82;
  text-transform: uppercase;
}

h1 .joiner {
  margin: 0.55em 0 0.45em 0.35em;
  font-size: 0.12em;
  line-height: 1;
  text-transform: lowercase;
}

.event-details {
  display: grid;
  min-width: max-content;
  gap: 8px;
  justify-items: start;
  padding-bottom: 0.45em;
}

.date-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 0 0 6px;
  border: 0;
  border-bottom: 1px solid transparent;
  color: inherit;
  background: transparent;
  font: inherit;
  font-size: clamp(0.95rem, 1.45vw, 1.15rem);
  line-height: 1.3;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 180ms ease;
}

.calendar-mark {
  font-size: 1.3em;
  line-height: 0.8;
}

.location {
  margin: 0;
  font-size: clamp(0.9rem, 1.2vw, 1rem);
  font-weight: 400;
  letter-spacing: 0;
}

.date-link:hover,
.date-link:focus-visible {
  border-bottom-color: currentColor;
}

.date-link:focus-visible,
.close-button:focus-visible,
.calendar-options a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

.calendar-dialog {
  width: min(380px, calc(100% - 32px));
  padding: 28px;
  border: 1px solid rgb(241 211 154 / 35%);
  border-radius: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-sans);
  box-shadow: 0 20px 60px rgb(31 29 26 / 20%);
}

.calendar-dialog::backdrop {
  background: rgb(24 8 7 / 62%);
}

.calendar-dialog h2 {
  margin: 0 44px 24px 0;
  font-family: var(--font-sans);
  font-size: 1.35rem;
  font-weight: 400;
  letter-spacing: 0;
}

.close-button {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  border: 0;
  color: inherit;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}

.calendar-options {
  display: grid;
  gap: 10px;
}

.calendar-options a {
  min-height: 48px;
  padding: 13px 16px;
  border: 1px solid rgb(241 211 154 / 40%);
  border-radius: 0;
  color: inherit;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
}

.calendar-options a:hover {
  color: var(--paper);
  background: var(--ink);
}

@keyframes portrait-reveal {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 520px) {
  .title-card {
    grid-template-columns: 1fr;
    min-height: calc(100vh - 28px);
    min-height: calc(100svh - 28px);
    align-content: end;
    gap: 34px;
    padding: max(24px, env(safe-area-inset-top)) 20px
      max(28px, env(safe-area-inset-bottom));
  }

  h1 {
    font-size: clamp(3.15rem, 15.5vw, 4.5rem);
    line-height: 0.84;
  }

  h1 .joiner {
    margin-top: 0.7em;
    margin-bottom: 0.6em;
    font-size: 0.17em;
  }

  .event-details {
    min-width: 0;
    gap: 7px;
    padding-bottom: 0;
  }

  .date-link {
    font-size: 1rem;
    line-height: 1.35;
  }

  .location {
    font-size: 0.95rem;
    line-height: 1.4;
  }

  .calendar-dialog {
    width: 100%;
    max-width: none;
    margin: auto 0 0;
    padding: 28px 20px calc(20px + env(safe-area-inset-bottom));
    border-width: 1px 0 0;
    border-radius: 0;
  }
}

@media (max-width: 360px) {
  h1 {
    font-size: 2.85rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .photo-section img {
    animation: none;
  }
}
