:root {
  --ink: #f3eee4;
  --ink-soft: rgba(243, 238, 228, 0.86);
  --ink-mute: rgba(243, 238, 228, 0.62);
  --line: rgba(243, 238, 228, 0.22);
  --live: #7dcc8a;
  --shadow: #07080b;
  --px: 0.5;
  --py: 0.5;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--shadow);
  font-family: "Sora", system-ui, sans-serif;
  font-weight: 400;
  letter-spacing: 0.01em;
  overflow-x: hidden;
}

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  z-index: 20;
  padding: 8px 12px;
  color: var(--shadow);
  background: var(--ink);
  font-size: 0.8rem;
}

.skip:focus {
  top: 12px;
}

/* ================================================================
   ENVIRONMENT
   ================================================================ */

.world {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.world-film {
  position: absolute;
  inset: -6%;
  width: 112%;
  height: 112%;
  object-fit: cover;
  filter: saturate(0.78) contrast(1.12) brightness(0.62);
  transform: translate3d(calc((var(--px) - 0.5) * -18px), calc((var(--py) - 0.5) * -12px), 0);
  will-change: transform;
}

.world-grade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(7, 8, 11, 0.28) 0%, transparent 22%, transparent 58%, rgba(7, 8, 11, 0.72) 100%),
    linear-gradient(90deg, rgba(7, 8, 11, 0.22) 0%, transparent 24%, rgba(7, 8, 11, 0.18) 58%, rgba(7, 8, 11, 0.58) 100%),
    radial-gradient(ellipse at 50% 38%, transparent 20%, rgba(7, 8, 11, 0.45) 100%);
}

.world-haze {
  position: absolute;
  inset: -10%;
  background:
    radial-gradient(ellipse at 40% 35%, rgba(180, 198, 210, 0.12), transparent 42%),
    radial-gradient(ellipse at 70% 60%, rgba(40, 52, 48, 0.2), transparent 46%);
  transform: translate3d(calc((var(--px) - 0.5) * 22px), calc((var(--py) - 0.5) * 14px), 0);
  mix-blend-mode: screen;
  opacity: 0.7;
}

.world-rain,
.world-rain-far {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(
    180deg,
    transparent 0%,
    rgba(255, 255, 255, 0.09) 50%,
    transparent 100%
  );
  background-size: 3px 72px;
  background-repeat: repeat;
  opacity: 0.1;
  animation: rain 0.55s linear infinite;
  mask-image: linear-gradient(180deg, transparent, #000 18%, #000 82%, transparent);
}

.world-rain-far {
  background-size: 5px 110px;
  opacity: 0.06;
  animation-duration: 0.95s;
  transform: translate3d(8px, 0, 0);
}

@keyframes rain {
  from { background-position: 0 -72px; }
  to { background-position: 0 72px; }
}

.world-grain {
  position: absolute;
  inset: 0;
  opacity: 0.045;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.world-letterbox {
  position: absolute;
  left: 0;
  right: 0;
  height: 7.5vh;
  z-index: 2;
}

.world-letterbox-top {
  top: 0;
  background: linear-gradient(180deg, rgba(7, 8, 11, 0.92), transparent);
}

.world-letterbox-bottom {
  bottom: 0;
  background: linear-gradient(0deg, rgba(7, 8, 11, 0.92), transparent);
}

.world-wash {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    640px circle at calc(var(--px) * 100%) calc(var(--py) * 100%),
    rgba(255, 244, 226, 0.08),
    transparent 48%
  );
}

/* ================================================================
   FRAME / PAGE
   ================================================================ */

.frame {
  position: relative;
  z-index: 3;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 28px 5.5vw 24px;
}

.meta {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: lowercase;
  color: var(--ink-mute);
}

.meta-time {
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
  letter-spacing: 0.12em;
}

.meta-rule {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line), transparent 88%);
}

.sheet {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 6vw;
  align-items: end;
  padding: 6vh 0 12vh;
}

/* ================================================================
   IDENTITY
   ================================================================ */

.self {
  max-width: 720px;
  animation: rise 1.1s cubic-bezier(.16,.8,.24,1) both;
}

.print {
  display: block;
  width: 58px;
  height: 78px;
  object-fit: cover;
  border-radius: 2px;
  margin: 0 0 28px 4px;
  transform: rotate(-3deg);
  filter: saturate(0.7) contrast(1.05);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.18),
    0 18px 40px rgba(0, 0, 0, 0.45);
}

.mark {
  margin: 0;
  font-family: "Fraunces", "Times New Roman", serif;
  font-style: italic;
  font-weight: 300;
  font-optical-sizing: auto;
  font-size: clamp(4.2rem, 10.6vw, 9rem);
  line-height: 0.78;
  letter-spacing: -0.045em;
  color: #f6f1e7;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.18),
    0 18px 50px rgba(0, 0, 0, 0.55);
}

.lede {
  margin: 28px 0 0;
  max-width: 22em;
  font-size: 0.98rem;
  font-weight: 300;
  line-height: 1.55;
  color: var(--ink-soft);
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.8);
}

.lede-lit {
  font-style: normal;
  font-weight: 400;
  color: #e2c68a;
}

.lede-wiki {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  font-family: "Fraunces", serif;
  font-style: italic;
  font-weight: 400;
  color: #8080f8;
  text-decoration: none;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.8);
  transition: color 0.3s ease;
}

.lede-wiki-mark {
  width: 1.35em;
  height: 1.35em;
  object-fit: contain;
  object-position: center;
  display: block;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.55));
}

.lede-wiki:hover,
.lede-wiki:focus-visible {
  color: #a0a0ff;
}

.lede-wiki:focus-visible {
  outline: 1px solid rgba(128, 128, 248, 0.7);
  outline-offset: 4px;
}

/* ================================================================
   PLACES (not cards — a caption index)
   ================================================================ */

.rail {
  position: relative;
  animation: rise 1.2s 0.12s cubic-bezier(.16,.8,.24,1) both;
}

.rail::before {
  content: "";
  position: absolute;
  inset: -36px -48px -48px -56px;
  background: radial-gradient(ellipse at 70% 50%, rgba(7, 8, 11, 0.55), transparent 72%);
  filter: blur(18px);
  z-index: -1;
  pointer-events: none;
}

.places {
  display: flex;
  flex-direction: column;
}

.place {
  display: grid;
  grid-template-columns: 7.2rem minmax(0, 1fr) 1.2rem;
  gap: 12px;
  align-items: center;
  padding: 13px 2px;
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  transition: background 0.35s ease, padding-left 0.35s cubic-bezier(.2,.7,.2,1);
}

.place:first-child {
  border-top: 1px solid var(--line);
}

.place-kind {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: lowercase;
  color: var(--ink-mute);
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.85);
}

.place-kind .brand {
  width: 14px;
  height: 14px;
  display: block;
  flex-shrink: 0;
  opacity: 0.7;
}

.place-kind img.brand {
  object-fit: contain;
}

.place-name {
  font-size: 0.92rem;
  font-weight: 400;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.9);
}

.place-go {
  justify-self: end;
  color: var(--ink-mute);
  transform: translate(-2px, 2px);
  transition: transform 0.35s cubic-bezier(.2,.7,.2,1), color 0.35s ease;
}

.place:hover,
.place:focus-visible {
  padding-left: 8px;
}

.place:hover .place-name,
.place:focus-visible .place-name {
  color: var(--ink);
}

.place:hover .place-go,
.place:focus-visible .place-go {
  color: var(--ink);
  transform: translate(1px, -1px);
}

.place:focus-visible {
  outline: 1px solid rgba(243, 238, 228, 0.55);
  outline-offset: 4px;
}

/* ================================================================
   FRIENDS — same prints, stacked inside a caption-row dropdown
   ================================================================ */

.company {
  margin: 0;
  border-bottom: 1px solid var(--line);
}

.company-sum {
  display: grid;
  grid-template-columns: 7.2rem minmax(0, 1fr) 1.2rem;
  gap: 12px;
  align-items: center;
  padding: 13px 2px;
  cursor: pointer;
  list-style: none;
  transition: padding-left 0.35s cubic-bezier(.2,.7,.2,1);
}

.company-sum::-webkit-details-marker,
.company-sum::marker {
  display: none;
  content: "";
}

.company-sum:hover,
.company-sum:focus-visible {
  padding-left: 8px;
}

.company-sum:focus-visible {
  outline: 1px solid rgba(243, 238, 228, 0.55);
  outline-offset: 4px;
}

.company-peek {
  display: flex;
  align-items: center;
  gap: 7px;
}

.company-peek img {
  width: 18px;
  height: 24px;
  object-fit: cover;
  object-position: center 18%;
  border-radius: 1px;
  filter: saturate(0.72) contrast(1.05);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.14),
    0 8px 16px rgba(0, 0, 0, 0.35);
}

.company-peek img:nth-child(odd) {
  transform: rotate(-3deg);
}

.company-peek img:nth-child(even) {
  transform: rotate(2.5deg);
}

.company-caret {
  justify-self: end;
  width: 7px;
  height: 7px;
  margin-bottom: 3px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  color: var(--ink-mute);
  transform: rotate(45deg);
  transition: transform 0.35s cubic-bezier(.2,.7,.2,1), color 0.35s ease;
}

.company-sum:hover .company-caret,
.company[open] .company-caret {
  color: var(--ink);
}

.company[open] .company-caret {
  transform: rotate(225deg);
}

.company-list {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding: 4px 2px 16px;
}

.companion {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
  transition: transform 0.4s cubic-bezier(.2,.7,.2,1);
}

.companion img {
  width: 34px;
  height: 44px;
  object-fit: cover;
  object-position: center 18%;
  border-radius: 2px;
  transform: rotate(-3deg);
  filter: saturate(0.72) contrast(1.05);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.16),
    0 12px 22px rgba(0, 0, 0, 0.4);
  transition: transform 0.4s cubic-bezier(.2,.7,.2,1), filter 0.4s ease;
}

.companion:nth-child(odd) img {
  transform: rotate(-3deg);
}

.companion:nth-child(even) img {
  transform: rotate(2.5deg);
}

.companion-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.companion em {
  font-family: "Fraunces", serif;
  font-style: italic;
  font-weight: 400;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.85);
}

.companion small {
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  text-transform: lowercase;
  color: var(--ink-mute);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8);
}

.companion:hover,
.companion:focus-visible {
  transform: translateX(3px);
}

.companion:hover img,
.companion:focus-visible img {
  transform: rotate(-0.5deg);
  filter: saturate(0.92) contrast(1.08);
}

.companion:nth-child(even):hover img,
.companion:nth-child(even):focus-visible img {
  transform: rotate(0.5deg);
}

.companion:focus-visible {
  outline: 1px solid rgba(243, 238, 228, 0.55);
  outline-offset: 6px;
}

/* ================================================================
   COMMUNITY — a continuation of the index, not a widget
   ================================================================ */

.gathering {
  margin-top: 22px;
}

.gathering-next {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.gathering-hit {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 4px 2px;
  color: inherit;
  text-decoration: none;
  transition: transform 0.4s cubic-bezier(.2,.7,.2,1);
}

.gathering-hit:hover {
  transform: translateX(4px);
}

.gathering-hit:focus-visible {
  outline: 1px solid rgba(243, 238, 228, 0.55);
  outline-offset: 6px;
}

.gathering-seal {
  width: 42px;
  height: 42px;
  border-radius: 50% 40% 50% 45%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.28);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.16),
    0 10px 24px rgba(0, 0, 0, 0.35);
  color: var(--ink-soft);
}

.gathering-seal img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gathering-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.gathering-name {
  font-family: "Fraunces", serif;
  font-style: italic;
  font-weight: 400;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.85);
}

.gathering-desc {
  font-size: 0.72rem;
  color: var(--ink-mute);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.85);
}

.gathering-count {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

.gathering-error {
  font-size: 0.72rem;
  color: var(--ink-mute);
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 10px rgba(125, 204, 138, 0.8);
}

.gathering-join {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: lowercase;
  color: var(--ink-mute);
  white-space: nowrap;
}

.gathering-hit:hover .gathering-join {
  color: var(--ink);
}

.faces {
  margin-top: 14px;
  padding-left: 56px;
}

.faces-row {
  display: flex;
  align-items: center;
}

.faces-row img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  margin-left: -7px;
  border: 1px solid rgba(7, 8, 11, 0.7);
  filter: saturate(0.85);
}

.faces-row img:first-child {
  margin-left: 0;
}

.member-more {
  margin-left: 10px;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--ink-mute);
}

/* ================================================================
   FOOTER
   ================================================================ */

.colophon {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: lowercase;
  color: var(--ink-mute);
}

.looks {
  font-variant-numeric: tabular-nums;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ================================================================
   RESPONSIVE
   ================================================================ */

@media (max-height: 820px) {
  .sheet {
    align-items: center;
    padding: 4vh 0;
  }
}

@media (max-width: 1080px) {
  .sheet {
    grid-template-columns: 1fr 320px;
    gap: 4vw;
  }

  .mark {
    font-size: clamp(4.2rem, 11vw, 8rem);
  }
}

@media (max-width: 860px) {
  .frame {
    padding: 22px 6vw 28px;
  }

  .sheet {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 48px;
    padding: 7vh 0 4vh;
  }

  .self {
    max-width: none;
  }

  .mark {
    font-size: clamp(4.4rem, 18vw, 7rem);
  }

  .lede {
    max-width: 28em;
  }

  .places {
    max-width: none;
  }

  .rail {
    max-width: 520px;
  }
}

@media (max-width: 540px) {
  .frame {
    padding: 18px 22px 22px;
  }

  .meta {
    justify-content: space-between;
  }

  .meta-rule {
    display: none;
  }

  .print {
    width: 48px;
    height: 64px;
    margin-bottom: 20px;
  }

  .mark {
    font-size: clamp(3.8rem, 22vw, 5.4rem);
  }

  .lede {
    font-size: 0.92rem;
    margin-top: 20px;
  }

  .place {
    grid-template-columns: 6.4rem minmax(0, 1fr) 1rem;
    padding: 12px 0;
  }

  .company-sum {
    grid-template-columns: 6.4rem minmax(0, 1fr) 1rem;
    padding: 12px 0;
  }

  .companion img {
    width: 30px;
    height: 40px;
  }

  .gathering-hit {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: start;
  }

  .faces {
    padding-left: 52px;
  }

  .world-letterbox {
    height: 4.5vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  .world-film {
    display: none;
  }

  .world-grade {
    background: #12151c;
  }

  .world-rain,
  .world-rain-far,
  .world-haze,
  .world-wash {
    animation: none;
    display: none;
  }

  .self,
  .rail,
  .place,
  .company-sum,
  .company-caret,
  .companion,
  .gathering-hit,
  .place-go {
    animation: none;
    transition: none;
  }
}
