/* Sleepy Expedition: an old expedition journal, opened at night. */

:root {
  --navy: #13172a;
  --navy-deep: #0d1020;
  --navy-raised: #1a1f38;
  --cream: #f2e7d0;
  --cream-soft: #d9cfbb;
  --gold: #c9a86a;
  --gold-bright: #dcbf86;
  --gold-faint: rgba(201, 168, 106, 0.28);

  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --sans: "Lato", system-ui, -apple-system, "Segoe UI", sans-serif;

  color-scheme: dark;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background-color: var(--navy);
  background-image: radial-gradient(ellipse 120% 70% at 50% 0%, #1b2140 0%, var(--navy) 55%, var(--navy-deep) 100%);
  background-attachment: fixed;
  color: var(--cream);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  overflow-x: hidden;
}

/* ---------- Background chart ---------- */

.chart {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  color: var(--gold);
}
.chart .rhumb { opacity: 0.07; }
.chart .rose { opacity: 0.1; }
.chart .rose--small { opacity: 0.07; }
.chart .stars { color: var(--cream); }
.chart .stars--1 { opacity: 0.55; animation: twinkle 9s ease-in-out infinite; }
.chart .stars--2 { opacity: 0.4;  animation: twinkle 13s ease-in-out -4s infinite; }
.chart .stars--3 { opacity: 0.7;  animation: twinkle 17s ease-in-out -9s infinite; }

@keyframes twinkle {
  0%, 100% { opacity: 0.2; }
  50%      { opacity: 0.75; }
}

/* ---------- Layout ---------- */

.page {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  max-width: 34rem;
  margin: 0 auto;
  padding: max(2.75rem, env(safe-area-inset-top)) 1.25rem 2rem;
  text-align: center;
}

/* ---------- Header ---------- */

.logo {
  display: block;
  width: clamp(140px, 40vw, 180px);
  height: auto;
  margin: 0 auto 1.5rem;
  border-radius: 50%;
  box-shadow:
    0 0 0 1px var(--gold-faint),
    0 0 0 7px rgba(19, 23, 42, 0.9),
    0 0 0 8px rgba(201, 168, 106, 0.16),
    0 0 60px 10px rgba(220, 191, 134, 0.08);
}

h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.5rem, 11vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: 0.01em;
  color: var(--cream);
}

.tagline {
  max-width: 22rem;
  margin: 0.9rem auto 0;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.8;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}

.divider {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  max-width: 14rem;
  margin: 2rem auto;
}
.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-faint));
}
.divider::after { background: linear-gradient(270deg, transparent, var(--gold-faint)); }
.divider span {
  width: 7px;
  height: 7px;
  transform: rotate(45deg);
  border: 1px solid var(--gold);
}

/* ---------- Story ---------- */

.story p {
  margin: 0 0 1.1rem;
  text-wrap: pretty;
  color: var(--cream-soft);
}
.story .field-note {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: 1.2rem;
  line-height: 1.5;
  color: var(--cream);
  text-wrap: balance;
}

/* ---------- Links ---------- */

.links {
  list-style: none;
  margin: 2.25rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.8rem;
}

.link {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-height: 3.6rem;
  padding: 0.8rem 1.1rem;
  border: 1px solid var(--gold-faint);
  border-radius: 14px;
  background: rgba(26, 31, 56, 0.72);
  color: var(--cream);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.4s ease, background-color 0.4s ease, color 0.4s ease;
}
.link__icon { display: flex; color: var(--gold); transition: color 0.4s ease; }
.link__label { flex: 1; text-align: left; }
.link__arrow { display: flex; color: var(--gold); opacity: 0.55; transition: opacity 0.4s ease, transform 0.4s ease; }

.link:hover {
  border-color: var(--gold);
  background-color: rgba(201, 168, 106, 0.1);
}
.link:hover .link__arrow { opacity: 1; transform: translateX(2px); }

.link--primary {
  min-height: 4rem;
  border-color: var(--gold);
  background: var(--gold);
  color: var(--navy-deep);
  font-size: 1.08rem;
  box-shadow: 0 8px 30px -10px rgba(220, 191, 134, 0.45);
}
.link--primary .link__icon,
.link--primary .link__arrow { color: var(--navy-deep); opacity: 1; }
.link--primary:hover {
  background: var(--gold-bright);
  border-color: var(--gold-bright);
}

:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
}
.link:focus-visible { border-radius: 14px; }

/* ---------- Latest expedition ---------- */

.latest { margin-top: 3rem; }
.latest h2 {
  margin: 0 0 1rem;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.7rem;
}
.video {
  position: relative;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--gold-faint);
  border-radius: 14px;
  overflow: hidden;
  background: var(--navy-deep);
}
.video iframe,
.video__poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.video__poster { padding: 0; background: none; cursor: pointer; }
.video__poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
  transition: opacity 0.4s ease;
}
.video__poster:hover img { opacity: 1; }
.video__play {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 4rem;
  height: 4rem;
  margin: -2rem 0 0 -2rem;
  border-radius: 50%;
  background: rgba(13, 16, 32, 0.8);
  border: 1px solid var(--gold);
  color: var(--gold-bright);
}

/* ---------- Closing + footer ---------- */

.closing {
  margin: 3rem 0 0;
  text-wrap: balance;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: 1.35rem;
  line-height: 1.4;
  color: var(--cream);
}

.horizon {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: clamp(190px, 30vw, 360px);
  margin-top: 1rem;
  padding-bottom: max(1.25rem, env(safe-area-inset-bottom));
  background-color: var(--navy-deep);
  background-image: url("/assets/horizon.jpg");
  background-image: image-set(url("/assets/horizon.webp") type("image/webp"), url("/assets/horizon.jpg") type("image/jpeg"));
  background-size: cover;
  background-position: center top;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 22%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 22%);
}
.horizon p {
  margin: 0;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--cream);
  text-shadow: 0 1px 6px rgba(13, 16, 32, 0.9);
}

@media (min-width: 48rem) {
  .page { padding-top: 4.5rem; }
  .horizon { background-size: 100% auto; background-repeat: no-repeat; }
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .chart .stars { animation: none !important; }
  *,
  *::before,
  *::after { transition-duration: 0.01ms !important; }
}
