:root {
  color-scheme: dark;
  font-family: "Avenir Next", Avenir, system-ui, sans-serif;
  font-synthesis: none;
  --background: #191529;
  --surface: #221d38;
  --border: #453956;
  --ink: #fff8ff;
  --secondary: #c7bdd8;
  --accent: #d8baff;
  --button-text: #231137;
  --map-background: #dfe5dc;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  display: flex;
  min-height: 100vh;
  min-height: 100svh;
  flex-direction: column;
  margin: 0;
  background: var(--background);
  color: var(--ink);
}

a { color: inherit; text-underline-offset: .24em; }

:is(a, button, input, iframe):focus-visible {
  outline: 3px solid #edcdff;
  outline-offset: 5px;
}

.page-width {
  width: min(100% - 104px, 1280px);
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 2;
  inset: 12px auto auto 12px;
  padding: 12px 16px;
  transform: translateY(-160%);
  border-radius: 8px;
  background: var(--accent);
  color: var(--button-text);
  font-weight: 700;
}

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

.site-header, .site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-header {
  min-height: 78px;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -.035em;
  text-decoration: none;
}

.brand img { flex: none; border-radius: 9px; }

.site-header nav, .site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
}

.site-header nav a, .site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--secondary);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}

.site-header nav a:hover, .site-footer a:hover { color: var(--ink); text-decoration: underline; }
.site-header nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; }

.site-footer {
  min-height: 72px;
  margin-top: auto;
  border-top: 1px solid var(--border);
}

.site-footer .studio { color: var(--ink); }

.home, .preview {
  display: grid;
  grid-template-columns: minmax(0, .86fr) minmax(0, 1.14fr);
  align-items: center;
  gap: clamp(36px, 6vw, 88px);
  padding-block: clamp(44px, 9vh, 104px);
}

.home h1, .preview h1, .status h1, .saved h1 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -.055em;
  line-height: .98;
  text-wrap: balance;
}

.home h1 {
  max-width: 8.5ch;
  font-size: clamp(64px, 8vw, 132px);
}

.home-copy > p, .status p {
  max-width: 34ch;
  margin: 27px 0 0;
  color: var(--secondary);
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.55;
}

.home-actions, .preview-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin-top: 30px;
}

.button, .text-link {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
}

.button {
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-family: inherit;
  text-decoration: none;
}

button.button { cursor: pointer; }
button.button:disabled { cursor: default; opacity: .65; }
.button-primary { background: var(--accent); color: var(--button-text); }
.button-primary:hover { background: #edd9ff; }
.button-secondary { border-color: #806698; background: transparent; color: var(--accent); }
.button-secondary:hover, .save-place[aria-pressed="true"] { border-color: var(--accent); background: #362449; color: var(--ink); }
.text-link { color: var(--accent); }
.text-link:hover { color: var(--ink); }

.save-place { gap: 8px; }

.save-place::before {
  width: 12px;
  height: 16px;
  flex: none;
  background: currentColor;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 74%, 0 100%, 0 0, 15% 13%, 15% 73%, 50% 54%, 85% 73%, 85% 13%, 15% 13%);
  content: "";
}

.save-place[aria-pressed="true"]::before {
  background: var(--accent);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 74%, 0 100%);
}

.save-status {
  margin: 12px 0 0;
  color: var(--secondary);
  font-size: 14px;
  line-height: 1.5;
}

.save-status:empty { margin: 0; }

.map-panel {
  min-width: 0;
  overflow: hidden;
  margin: 0;
  border: 1px solid #695583;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 16px 64px #08051368;
}

.map-frame {
  display: block;
  width: 100%;
  min-height: 390px;
  aspect-ratio: 1.2;
  border: 0;
  background: var(--map-background);
  color-scheme: light;
}

.map-frame:focus-visible { outline-offset: -5px; outline-color: #532b81; }

.map-caption {
  display: flex;
  min-height: 58px;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 16px;
  padding: 6px 16px;
  color: var(--secondary);
  font-size: 12px;
  line-height: 1.35;
}

.map-caption span {
  flex: 1 1 160px;
  padding: 8px 0 3px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.map-caption a {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
}

.map-caption a:last-child { margin-inline-start: auto; }

.preview {
  align-items: start;
  padding-block: clamp(35px, 8vh, 90px);
}

.preview h1, .status h1 { font-size: clamp(48px, 6vw, 88px); }
.preview h1 { max-width: 12ch; }

.posted {
  margin: 14px 0 0;
  color: var(--secondary);
  font-size: 14px;
}

.note {
  margin: 28px 0 0;
  padding-inline-start: 19px;
  border-inline-start: 2px solid var(--accent);
  color: var(--ink);
  font-size: clamp(19px, 2.25vw, 26px);
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.directions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-top: 12px;
}

.directions a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: var(--accent);
  font-size: 14px;
  font-weight: 650;
}

.directions a:hover { color: var(--ink); }

.status { padding-block: clamp(66px, 16vh, 156px); }
.status h1 { max-width: 16ch; }
.status .button { margin-top: 28px; }

.share-handoff {
  max-width: 480px;
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.share-handoff .handoff-help {
  margin: 0;
  color: var(--secondary);
  font-size: 15px;
  line-height: 1.5;
}

.handoff-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  margin-top: 12px;
}

.share-handoff .button { margin-top: 0; }

.share-handoff .save-status { font-size: 14px; }

.saved { padding-block: clamp(40px, 8vh, 94px); }
.saved-content { max-width: 760px; }
.saved h1 { font-size: clamp(45px, 7vw, 88px); }

.saved-description {
  max-width: 48ch;
  margin: 16px 0 0;
  color: var(--secondary);
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.55;
}

.saved-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.saved-actions .button { margin-top: 22px; }

.saved-items {
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
}

.saved-items:empty { margin: 0; }

.saved-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 20px;
  padding-block: 15px;
  border-top: 1px solid var(--border);
}

.saved-item:last-child { border-bottom: 1px solid var(--border); }
.saved-item-copy { min-width: 0; }

.saved-item-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: var(--accent);
  font-size: 19px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.saved-item-link:hover { color: var(--ink); }

.saved-item-text {
  margin: 0;
  color: var(--secondary);
  font-size: 16px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.saved-item-remove {
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--secondary);
  font: inherit;
  font-size: 14px;
  white-space: nowrap;
  cursor: pointer;
}

.saved-item-remove:hover { border-color: var(--secondary); color: var(--ink); }
.saved-item-unavailable { color: var(--secondary); }

.saved-empty, .share-fallback {
  margin: 28px 0 0;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--secondary);
}

.saved-empty h2 { margin: 0; color: var(--ink); font-size: 21px; }
.saved-empty p { margin: 6px 0 0; line-height: 1.5; }
.saved-empty .text-link { margin-bottom: -8px; }
.share-fallback label { display: block; margin-bottom: 8px; color: var(--ink); font-weight: 700; }

.share-fallback input {
  width: 100%;
  min-height: 44px;
  padding: 10px;
  border: 1px solid #806698;
  border-radius: 8px;
  background: var(--background);
  color: var(--ink);
  font: inherit;
}

@media (max-width: 850px) {
  .page-width { width: min(100% - 56px, 680px); }

  .home, .preview {
    grid-template-columns: minmax(0, 1fr);
    gap: 34px;
  }

  .home h1 { max-width: 11ch; font-size: clamp(62px, 12vw, 102px); }
  .home-copy > p, .status p { margin-top: 18px; }
  .map-frame { min-height: 318px; aspect-ratio: 1.45; }
}

@media (max-width: 450px) {
  .page-width { width: calc(100% - 36px); }
  .site-header { min-height: 67px; }
  .site-header nav { gap: 8px 14px; }
  .site-footer { gap: 10px; }
  .site-footer nav { gap: 6px 12px; }
  .site-footer a { font-size: 12px; }
  .brand { gap: 9px; font-size: 19px; }
  .brand img { width: 34px; height: 34px; }
  .home h1 { font-size: clamp(46px, 12.7vw, 65px); }
  .home-actions, .preview-actions { margin-top: 23px; }
  .map-panel { border-radius: 15px; }
  .map-frame { min-height: 275px; }
  .map-caption { padding-inline: 11px; gap: 0 10px; }
  .map-caption span { flex-basis: 100%; }
  .map-caption a:last-child { margin-inline-start: 0; }
}
