/*
 * The home page (#719). It builds on tokens.css (07 section 6: paper and ink, one Ember accent, Instrument Serif and
 * Inter) and borrows the map's own vocabulary from 07 section 6.7 for its one bold moment: the hero is a piece of the
 * basemap (its land, water, and label colors), with the route gradient drawing an M across it and real photo markers,
 * ringed in traveler colors, along the way. Everything below the hero stays quiet.
 *
 * No script and no inline style (SEC-140). The single orchestrated motion is the route drawing in and the markers
 * popping in after it; `prefers-reduced-motion` shows the finished map at once.
 */

:root {
  --land: #efe6d2;
  --land-line: rgb(74 63 49 / 14%);
  --water: #9fd3cd;
  --route-from: #ffd27a;
  --route-to: #ff5a45;
  --keyline: rgb(16 17 20 / 55%);
  --marker-shadow: 0 7px 16px rgb(20 14 6 / 38%);
  --traveler-1: #e4572e;
  --traveler-2: #1f3a93;
  --traveler-3: #8cc8ff;
  --card: rgb(255 255 255 / 92%);
  --gutter: 16px;
  --measure: 34rem;
  /* The page's column: 1240 px wide, centered; full-bleed bands pad their content to it. */
  --column: 1240px;
  --inline-start: max(calc(var(--gutter) + var(--safe-left)), calc((100% - var(--column)) / 2));
  --inline-end: max(calc(var(--gutter) + var(--safe-right)), calc((100% - var(--column)) / 2));
}

@media (prefers-color-scheme: dark) {
  :root {
    --land: #1b1915;
    --land-line: rgb(233 223 203 / 9%);
    --water: #1e3436;
    --keyline: rgb(242 239 232 / 55%);
    --marker-shadow: 0 7px 18px rgb(0 0 0 / 55%);
    --card: rgb(24 25 29 / 92%);
  }
}

@media (min-width: 720px) {
  :root {
    --gutter: 24px;
  }
}

@media (min-width: 1080px) {
  :root {
    --gutter: 40px;
  }
}

/* --- Base -------------------------------------------------------------------------------------------------------- */

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

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body.home {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 1rem;
  line-height: 1.5;
  font-feature-settings: "cv11", "ss03";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

:where(.home) h1,
:where(.home) h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  text-wrap: balance;
}

:where(.home) h2 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1;
  letter-spacing: -0.005em;
}

:where(.home) h3 {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.3;
}

:where(.home) p {
  margin: 0;
  text-wrap: pretty;
}

.home a {
  color: inherit;
}

.home :focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 10;
  padding: var(--space-2) var(--space-4);
  background: var(--surface);
  border-radius: var(--r-pill);
}

.skip:focus {
  top: var(--space-3);
}

/* --- The wordmark and the buttons ------------------------------------------------------------------------------ */

/* 07 section 7: "Maui" in Instrument Serif roman, "Map" in italic accent-text, with the i-M join kerned in. */
.wordmark {
  display: inline-flex;
  align-items: baseline;
  font-family: var(--font-display);
  font-size: 1.75rem;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.wordmark em {
  margin-left: 0.04em;
  color: var(--accent-text);
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 var(--space-6);
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: var(--on-accent);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition:
    transform var(--motion-fast) var(--ease),
    background var(--motion-fast) var(--ease);
}

.home a.pill {
  color: var(--on-accent);
}

.pill:hover {
  transform: translateY(-1px);
}

.pill:active {
  transform: translateY(0);
}

.home a.pill-quiet {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--text);
}

.home a.pill-quiet:hover {
  background: var(--surface);
}

.pill-small {
  min-height: 40px;
  padding: 0 var(--space-4);
  font-size: 0.9375rem;
}

@media (prefers-reduced-motion: reduce) {
  .pill:hover {
    transform: none;
  }
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

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

.masthead {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: var(--space-6);
  padding: calc(var(--space-4) + var(--safe-top)) var(--inline-end) var(--space-4) var(--inline-start);
  background: var(--land);
}

.masthead-nav {
  display: none;
  gap: var(--space-6);
  margin-left: auto;
  font-size: 0.9375rem;
}

.masthead-nav a {
  text-decoration: none;
  color: var(--text-2);
}

.masthead-nav a:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.masthead .pill {
  margin-left: auto;
}

@media (min-width: 720px) {
  .masthead-nav {
    display: flex;
  }

  .masthead .pill {
    margin-left: 0;
  }
}

/* --- Hero: a piece of the map ---------------------------------------------------------------------------------- */

.hero {
  position: relative;
  overflow: hidden;
  background: var(--land);
  padding: var(--space-8) var(--inline-end) 0 var(--inline-start);
}

.contours {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: none;
  pointer-events: none;
}

.contour-lines {
  stroke: var(--land-line);
  stroke-width: 1.25;
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: var(--measure);
}

.hero h1 {
  font-size: clamp(3.25rem, 8.6vw, 7.25rem);
  line-height: 0.92;
  letter-spacing: -0.012em;
}

.lead {
  margin-top: var(--space-8);
  max-width: 31rem;
  color: var(--text-2);
  font-size: 1.0625rem;
  line-height: 1.55;
}

@media (min-width: 720px) {
  .lead {
    font-size: 1.1875rem;
  }
}

.hero .actions {
  margin-top: var(--space-8);
}

.fineprint {
  margin-top: var(--space-3);
  color: var(--text-3);
  font-size: 0.8125rem;
}

.hero-map {
  position: relative;
  margin: var(--space-4) calc(-1 * var(--gutter)) 0;
  height: 380px;
  --marker: 56px;
}

.route {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: none;
}

.river {
  fill: none;
  stroke: var(--water);
  stroke-width: 9;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.route-glow,
.route-line {
  stroke: url(#route-gradient);
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.route-glow {
  stroke-width: 16;
  opacity: 0.4;
  filter: blur(6px);
}

.route-line {
  stroke-width: 5;
}

/* 07 section 6.7's photo marker: a round thumb, a white halo, the traveler's ring, a keyline, and a warm shadow. Larger
   than the map's 44 px, because here the markers are the illustration. */
.marker {
  position: absolute;
  z-index: 1;
  width: var(--marker);
  height: var(--marker);
  translate: -50% -50%;
  border-radius: 50%;
  background: #cdbf9f;
  box-shadow:
    0 0 0 3px #ffffff,
    0 0 0 7px var(--ring),
    0 0 0 8px var(--keyline),
    var(--marker-shadow);
}

.marker img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.marker-active {
  --marker: 76px;
  box-shadow:
    0 0 0 3px #ffffff,
    0 0 0 8px var(--ring),
    0 0 0 9px var(--keyline),
    0 0 0 20px color-mix(in srgb, var(--ring) 28%, transparent),
    var(--marker-shadow);
}

.marker-count {
  position: absolute;
  top: -6px;
  right: -10px;
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  border: 1.5px solid #ffffff;
  border-radius: var(--r-pill);
  background: #14161a;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 23px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.traveler-1 {
  --ring: var(--traveler-1);
}

.traveler-2 {
  --ring: var(--traveler-2);
}

.traveler-3 {
  --ring: var(--traveler-3);
}

/* The markers sit on the route's own points (the SVG's viewBox is 1000 x 640 and is stretched to the box). */
.marker-a {
  left: 9%;
  top: 84.4%;
}

.marker-b {
  left: 28%;
  top: 27.3%;
}

.marker-c {
  left: 47%;
  top: 65.6%;
}

.marker-d {
  left: 69%;
  top: 20.3%;
}

.marker-e {
  left: 88%;
  top: 51.6%;
}

.map-card {
  position: absolute;
  z-index: 2;
  right: var(--gutter);
  bottom: var(--space-3);
  display: grid;
  gap: 2px;
  min-width: 200px;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--r-md);
  background: var(--card);
  box-shadow: var(--e2);
  backdrop-filter: blur(16px);
}

.map-card-day {
  color: var(--accent-text);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.map-card-place {
  font-family: var(--font-display);
  font-size: 1.375rem;
  line-height: 1.1;
}

.map-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ring);
  box-shadow: 0 0 0 1px var(--keyline);
}

@media (min-width: 720px) {
  .hero-map {
    height: 480px;
    --marker: 72px;
  }

  .marker-active {
    --marker: 96px;
  }

  /* Beside the active marker, as the viewer's map card sits by the moment it names. */
  .map-card {
    right: auto;
    bottom: auto;
    left: 69%;
    top: 20.3%;
    translate: -100% 0;
    margin: 70px 0 0 -26px;
  }
}

/* Desktop: the copy on the left, the map filling the right of the hero. */
@media (min-width: 1080px) {
  .hero {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    align-items: center;
    min-height: min(820px, calc(100svh - 72px));
    padding-top: var(--space-12);
    padding-bottom: var(--space-16);
  }

  .hero-map {
    margin: 0 calc(-1 * max(var(--gutter), (100vw - var(--column)) / 2)) 0 0;
    height: 100%;
    min-height: 560px;
    --marker: 80px;
  }

  .marker-active {
    --marker: 108px;
  }
}

/* The one orchestrated moment: the route draws itself, then each photo lands as the line reaches it. */
@media (prefers-reduced-motion: no-preference) {
  .route-line,
  .route-glow {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: draw 2200ms cubic-bezier(0.45, 0, 0.2, 1) 250ms forwards;
  }

  .marker,
  .map-card {
    opacity: 0;
    scale: 0.35;
    animation: land var(--motion-reveal) var(--ease) forwards;
  }

  .map-card {
    scale: 0.96;
  }

  .marker-a {
    animation-delay: 300ms;
  }

  .marker-b {
    animation-delay: 800ms;
  }

  .marker-c {
    animation-delay: 1250ms;
  }

  .marker-d {
    animation-delay: 1750ms;
  }

  .map-card {
    animation-delay: 2100ms;
  }

  .marker-e {
    animation-delay: 2250ms;
  }

  /* The closing marker is part of the still picture, not the hero's moment. */
  .marker-end {
    opacity: 1;
    scale: 1;
    animation: none;
  }
}

@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes land {
  to {
    opacity: 1;
    scale: 1;
  }
}

/* --- Sections ----------------------------------------------------------------------------------------------------- */

.demo,
.how,
.privacy,
.plans,
.closing {
  padding: var(--space-20) var(--inline-end) 0 var(--inline-start);
}

/* The demo: the copy, then the trip page on a computer with the phone over its corner. */
.demo {
  display: grid;
  gap: var(--space-10);
}

.demo-copy {
  display: grid;
  gap: var(--space-5);
  align-content: start;
  max-width: var(--measure);
}

.demo-copy p {
  color: var(--text-2);
  font-size: 1.0625rem;
}

.home .trip-meta {
  color: var(--text-3);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

.demo-copy .pill {
  justify-self: start;
}

.demo-shots {
  position: relative;
  display: block;
  padding-bottom: 12%;
}

.demo-shots img {
  display: block;
  width: 100%;
  height: auto;
}

.shot-desktop img {
  border-radius: var(--r-md);
  box-shadow:
    0 0 0 1px var(--line),
    var(--e3);
}

.shot-phone {
  position: absolute;
  right: 4%;
  bottom: 0;
  width: 27%;
}

.shot-phone img {
  border-radius: 14% / 6.5%;
  box-shadow:
    0 0 0 6px #14161a,
    0 0 0 7px rgb(255 255 255 / 18%),
    var(--e3);
}

@media (min-width: 1080px) {
  .demo {
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
    align-items: center;
    gap: var(--space-12);
  }
}

/* How it works: three stops on one route, the only numbered sequence on the page. */
.stops {
  position: relative;
  display: grid;
  gap: var(--space-10);
  margin: var(--space-10) 0 0;
  padding: 0;
  list-style: none;
}

.stops::before {
  content: "";
  position: absolute;
  left: 23px;
  top: 24px;
  bottom: 24px;
  border-left: 3px dashed color-mix(in srgb, var(--route-to) 70%, transparent);
}

.stops li {
  position: relative;
  display: grid;
  align-content: start;
  grid-template-columns: 48px minmax(0, 1fr);
  column-gap: var(--space-5);
  row-gap: var(--space-2);
}

.stops h3,
.stops p {
  grid-column: 2;
}

.stops p {
  color: var(--text-2);
  max-width: 26rem;
}

.stop {
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow:
    0 0 0 3px var(--accent),
    var(--e1);
  font-family: var(--font-display);
  font-size: 1.625rem;
  line-height: 1;
}

@media (min-width: 900px) {
  .stops {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-10);
  }

  .stops::before {
    left: 24px;
    right: calc(33% - 24px);
    top: 23px;
    bottom: auto;
    border-left: 0;
    border-top: 3px dashed color-mix(in srgb, var(--route-to) 70%, transparent);
  }

  .stops li {
    grid-template-columns: minmax(0, 1fr);
    row-gap: var(--space-3);
  }

  .stops h3,
  .stops p,
  .stop {
    grid-column: 1;
  }

  .stop {
    grid-row: auto;
    margin-bottom: var(--space-3);
  }
}

/* Privacy: four plain statements, between hairlines. */
.facts {
  display: grid;
  margin: var(--space-10) 0 0;
  border-top: 1px solid var(--line);
}

.facts div {
  display: grid;
  align-content: start;
  gap: var(--space-2);
  padding: var(--space-6) 0;
  border-bottom: 1px solid var(--line);
}

.facts dt {
  font-weight: 600;
}

.facts dd {
  margin: 0;
  max-width: 36rem;
  color: var(--text-2);
}

@media (min-width: 900px) {
  .facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--space-12);
  }
}

.more {
  margin-top: var(--space-6);
}

.more a,
.colophon a {
  text-underline-offset: 3px;
}

/* Free and HD. */
.plan-grid {
  display: grid;
  gap: var(--space-8);
  margin-top: var(--space-10);
}

.plan {
  display: grid;
  gap: var(--space-3);
  align-content: start;
  padding-top: var(--space-6);
  border-top: 2px solid var(--text);
}

.plan p {
  max-width: 30rem;
  color: var(--text-2);
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xs);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-hd {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}

.plan-note {
  margin-top: var(--space-8);
  color: var(--text-3);
  font-size: 0.9375rem;
}

@media (min-width: 900px) {
  .plan-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-12);
  }
}

/* The closing line: back on the map's paper, so the page ends where it began. */
.closing {
  margin-top: var(--space-20);
  padding-bottom: var(--space-20);
  background: var(--land);
}

.closing h2 {
  max-width: 14ch;
  font-size: clamp(3rem, 7vw, 5.5rem);
  line-height: 0.95;
}

.closing .actions {
  margin-top: var(--space-8);
}

/* A last stretch of route on the right, dotted like a day that is not the active one, ending on a photo. */
.closing {
  position: relative;
  overflow: hidden;
}

.closing-route {
  display: none;
}

@media (min-width: 900px) {
  .closing-route {
    display: block;
    position: absolute;
    top: 50%;
    right: var(--inline-end);
    width: min(46%, 600px);
    height: 260px;
    translate: 0 -40%;
  }

  .closing-route svg {
    width: 100%;
    height: 100%;
    overflow: visible;
    fill: none;
    stroke: url(#route-gradient);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: 1 12;
    vector-effect: non-scaling-stroke;
  }

  .closing-route path {
    vector-effect: non-scaling-stroke;
  }

  .marker-end {
    --marker: 88px;
    left: 93.3%;
    top: 46.2%;
  }
}

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

.colophon {
  display: grid;
  gap: var(--space-6);
  padding: var(--space-10) var(--inline-end) calc(var(--space-10) + var(--safe-bottom)) var(--inline-start);
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 0.875rem;
}

.colophon-top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-4) var(--space-10);
}

.colophon .wordmark {
  color: var(--text);
}

.colophon-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
}

.credits {
  display: grid;
  gap: var(--space-3);
  max-width: 48rem;
  color: var(--text-3);
  font-size: 0.8125rem;
}

.credits summary {
  cursor: pointer;
  color: var(--text-2);
}

.credit-list {
  margin: var(--space-3) 0 0;
  padding-left: 1.5em;
  columns: 2 18rem;
  column-gap: var(--space-8);
  font-size: 0.75rem;
}

.copyright {
  color: var(--text-3);
  font-size: 0.8125rem;
}

@media (prefers-contrast: more) {
  .contours {
    display: none;
  }

  .map-card {
    background: var(--surface);
    backdrop-filter: none;
  }
}
