:root {
  --bg: #0b0d10;
  --ink: #e8ebef;
  --muted: #6b7280;
  --line: #23272e;
}

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Datatype", ui-monospace, monospace;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

#card-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
}
#card-layer canvas { display: block; }

.overlay {
  position: fixed;
  bottom: 0;
  z-index: 2;
  padding: 2rem 2.25rem;
  pointer-events: none;
  font-size:14px;
  line-height: 1.65;
  letter-spacing: 0.06em;
}
.overlay--left  { left: 0; text-align: left; }
.overlay--right { right: 0; text-align: right;width: 200px; }

.overlay__label {
  margin: 0 0 0.6rem;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.overlay ul { margin: 0; padding: 0; list-style: none; }
.overlay li { margin: 0; }

.overlay a {
  pointer-events: auto;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, opacity 0.2s ease;
}
.overlay a:hover {}; }
.overlay a[aria-current] { border-bottom-color: var(--ink); }

.overlay--right a { pointer-events: auto; }

.overlay--left ul { pointer-events: auto; }

.overlay--left a:not(.offline):not(.archive):hover::after {
  content: "\2009\2197";
  font-size: 0.85em;
}
/* Archived: the arrow sits outside the tag, after it — 'domain ARCHIVE ↗' */
.overlay--left li:hover .archive-note::after,
.overlay--left a.archive[aria-current] + .archive-note::after {
  content: "\2197";
  position: absolute;
  left: 100%;                 /* just past the tag's right edge */
  top: 50%;
  transform: translateY(-50%);
  margin-left: 0.6em;
  font-size: 1.15em;
  line-height: 1;
  letter-spacing: 0;
  color: var(--ink);
}

.overlay--left .offline-note,
.overlay--left .archive-note {
  position: relative;   /* anchors the trailing arrow outside the tag */
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 1px 4px;
  margin-left: 0.55em;
  vertical-align: 1px;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.overlay--left a.offline:hover + .offline-note,
.overlay--left a.offline[aria-current] + .offline-note,
.overlay--left a.archive:hover + .archive-note,
.overlay--left a.archive[aria-current] + .archive-note { opacity: 1; }

.overlay .type-cursor { background: var(--ink); color: var(--bg); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

@media (max-width: 640px) {
  .overlay { padding: 1.25rem 1.25rem; font-size: 0.75rem; }
  .overlay--left, .overlay--right { max-width: 45vw; font-size: 1rem}
}

.overlay--right li {
  pointer-events: auto;
  display: block;
  height: 1.65em;
  text-align: right;
}

/* ---- Mobile: iOS-style curved picker wheel (replaces the hover list) ---- */
@media (hover: none) {
  /* email moves to the top-right */
  .overlay--right { top: 0; bottom: auto; }

  /* the site list becomes a curved, draggable wheel across the bottom-centre */
  .overlay--left {
    left: 0;
    right: 0;
    bottom: 0;
    max-width: none;
    height: 15em;
    padding: 0;
    font-size: 0.8rem;
    text-align: center;
    overflow: hidden;
    perspective: 800px;
    pointer-events: auto;
    touch-action: none;
    -webkit-user-select: none;
            user-select: none;
    opacity: 0;                        /* hidden until JS positions the items */
    transition: opacity 0.4s ease;
    -webkit-mask-image: linear-gradient(to bottom, transparent, #000 26%, #000 74%, transparent);
            mask-image: linear-gradient(to bottom, transparent, #000 26%, #000 74%, transparent);
  }
  .overlay--left.wheel-ready { opacity: 1; }
  .overlay--left ul {
    position: absolute;
    inset: 0;
    pointer-events: auto;
    transform-style: preserve-3d;
  }
  .overlay--left li {
    position: absolute;
    top: 50%;
    left: 50%;
    width: -webkit-fit-content;
    width: fit-content;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.5;
    white-space: nowrap;
    backface-visibility: hidden;
    will-change: transform, opacity;
  }
  .overlay--left li a { color: var(--ink); border-bottom-color: transparent; -webkit-user-drag: none; }

  /* the centred item = white pill */
  .overlay--left li.is-sel { background: #fff; border-radius: 3px; padding: 3px 8px; }
  .overlay--left li.is-sel a { color: #000; }
  /* plain items: reserve the arrow's width — plus a mirrored spacer on the
     left so the URL stays centred — on every item, and just reveal it when
     selected, so nothing shifts */
  .overlay--left li a:not(.offline):not(.archive)::before,
  .overlay--left li a:not(.offline):not(.archive)::after {
    content: "\2009\2197";
    color: transparent;
  }
  .overlay--left li a:not(.offline):not(.archive)::before { visibility: hidden; }
  .overlay--left li.is-sel a:not(.offline):not(.archive)::after { color: #000; }
  /* offline/archive never carry the arrow on the link itself */
  .overlay--left li a.offline::after,
  .overlay--left li a.archive::after { content: ""; }

  /* labels collapse to zero width so every URL is centred, then animate open
     when their item is selected */
  .overlay--left li .offline-note,
  .overlay--left li .archive-note {
    position: static;
    min-width: 0;
    max-width: 0;
    margin-left: 0;
    padding-left: 0;
    padding-right: 0;
    border-width: 0;
    opacity: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: max-width 0.28s ease, opacity 0.2s ease, margin 0.28s ease, padding 0.28s ease;
  }
  .overlay--left li.is-sel .offline-note,
  .overlay--left li.is-sel .archive-note {
    max-width: 8em;
    margin-left: 0.5em;
    padding: 1px 4px;
    border-width: 1px;
    border-color: #000;
    color: #000;
    opacity: 1;
  }
  /* archive: no arrow inside the tag; render it AFTER the tag, still inside
     the white pill */
  .overlay--left li.is-sel a.archive[aria-current] + .archive-note::after { content: ""; }
  .overlay--left li.is-sel:has(.archive-note)::after {
    content: "\2009\2197";
    margin-left: 0.4em;
    color: #000;
    font-size: 1.15em;
    letter-spacing: 0;
  }
}
