:root {
  --bg: #0d0d0f;
  --ink: #ece8df;
  --muted: #bdb8ae;
  --line: rgba(236, 232, 223, 0.18);
  --surface: rgba(13, 13, 15, 0.55);
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Geist", system-ui, sans-serif;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

#ribbons {
  /* Taps and drags drive the ribbon instead of panning or zooming the page. */
  touch-action: none;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

main {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 16px;
  pointer-events: none;
}

/* Soft dark halo so the ribbon never cuts through the text. */
main::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(820px, 100vw);
  height: 380px;
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(13, 13, 15, 0.6) 15%, rgba(13, 13, 15, 0));
  z-index: -1;
}

.name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(36px, 5.5vw, 74px);
  line-height: 1;
  letter-spacing: -0.02em;
}

.name .char {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.35em);
  filter: blur(12px);
  animation: reveal 1.1s var(--ease-out) forwards;
}

.tagline {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 12px;
  margin-top: 14px;
  font-size: clamp(15px, 1.6vw, 18px);
  color: var(--muted);
  letter-spacing: 0.01em;
  opacity: 0;
  animation: fade 1s ease forwards 1.1s;
}

/* Pin only shows on narrow screens, where the city gets its own line. */
.tagline .place svg {
  display: none;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Links start as icon circles; one opens at a time and stays open until another is entered (see main.js). */
.links {
  margin-top: 32px;
  display: flex;
  justify-content: center;
  gap: 10px;
  pointer-events: auto;
}

.link {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 46px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  color: var(--muted);
  font: 500 14px/1 var(--sans);
  text-decoration: none;
  opacity: 0;
  animation: pop 0.7s var(--ease-out) forwards;
  transition:
    color 0.4s ease,
    border-color 0.5s ease,
    box-shadow 0.6s ease,
    background-color 0.5s ease;
}

.link:nth-child(1) { animation-delay: 1.4s; }
.link:nth-child(2) { animation-delay: 1.5s; }
.link:nth-child(3) { animation-delay: 1.6s; }

.link svg {
  flex: none;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Grid 0fr -> 1fr animates to the label's exact width, so opening and closing keep an even pace. */
.link .label {
  display: grid;
  grid-template-columns: 0fr;
  transition: grid-template-columns 0.55s var(--ease-in-out);
}

.link .label > span {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  padding-left: 0;
  opacity: 0;
  transform: translateX(-6px);
  transition:
    padding-left 0.55s var(--ease-in-out),
    opacity 0.25s ease,
    transform 0.4s var(--ease-out);
}

.link.is-open {
  color: var(--ink);
  /* Frosted glass: lighter tint, brighter edge, a highlight along the top rim. */
  border-color: rgba(255, 255, 255, 0.22);
  background-color: rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -1px 0 rgba(255, 255, 255, 0.04),
    0 8px 24px rgba(0, 0, 0, 0.35);
}

.link.is-open .label { grid-template-columns: 1fr; }
.link.is-open .label > span {
  padding-left: 8px;
  opacity: 1;
  transform: none;
  transition:
    padding-left 0.55s var(--ease-in-out),
    opacity 0.4s ease 0.12s,
    transform 0.55s var(--ease-out) 0.05s;
}

.link:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* Phones and narrow windows: no open/close, all labels shown, stacked at equal width. */
@media (hover: none), (max-width: 600px) {
  .links {
    flex-direction: column;
    align-items: stretch;
    /* As wide as the longest label; the others stretch to match. */
    width: max-content;
  }
  .link { justify-content: center; padding: 0 20px; color: var(--ink); }
  /* Role and city on their own lines instead of one long line. */
  .tagline { flex-direction: column; gap: 4px; line-height: 1.4; }
  .tagline .separator { display: none; }
  .tagline .place { display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
  .tagline .place svg { display: block; }
  .link .label { grid-template-columns: 1fr; }
  .link .label > span { padding-left: 8px; opacity: 1; transform: none; }
}

@keyframes reveal { to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes fade { to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: scale(0.6); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .name .char, .tagline, .link { animation: none; opacity: 1; transform: none; filter: none; }
}
