/* PHANTOM theme "personal": a three.js scene behind a glass window; pages swap inside it without reloading */
  :root { --mono: 'Tomorrow', ui-monospace, monospace; }
  html, body { margin: 0; padding: 0; background: #232323; }
  * { box-sizing: border-box; }
  body { color: #e0e0e0; font-family: var(--mono); }
  .lil-gui { --font-family: var(--mono); }
  a { color: #e0e0e0; text-decoration: none; }
  a:hover { color: #fff; }
  ::selection { background: #ededed; color: #232323; }

  /* background layers */
  #bg { position: fixed; inset: 0; z-index: 0; display: block; }
  #labels { position: fixed; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
  #labels svg { position: absolute; inset: 0; width: 100%; height: 100%; }
  .label {
    position: absolute; left: 0; top: 0; white-space: pre; will-change: transform;
    font: 400 var(--label-size, 10px)/1.2 var(--mono); letter-spacing: 0.08em; text-transform: uppercase;
    color: rgb(var(--ui) / var(--ui-text));
  }
  .label i { display: inline-block; width: 5px; height: 5px; background: rgb(var(--ui) / var(--ui-text)); margin-right: 6px; vertical-align: 1px; }
  .label b { font-weight: 400; text-transform: none; }

  /* chrome */
  .frame { position: fixed; inset: 18px; border: 1px solid rgba(255,255,255,.075); pointer-events: none; z-index: 5; }

  /* nav bar: bordered cells right of the logo tile, the active one lit; only on inner pages (or after clicking the logo on the index) */
  .topbar { position: fixed; z-index: 9; display: flex; align-items: stretch; overflow: hidden;
    visibility: hidden; opacity: 0; pointer-events: none; clip-path: inset(0 100% 0 0); transform: translateX(-16px);   /* hidden: wiped back into the logo */
    transition: clip-path .6s cubic-bezier(.2,.7,.2,1), transform .6s cubic-bezier(.2,.7,.2,1), opacity .4s ease, visibility 0s linear .6s;
    left: calc(var(--logo-margin, 40px) + var(--logo-tile, 72px)); right: auto; max-width: calc(100vw - var(--logo-margin, 40px) * 2 - var(--logo-tile, 72px)); top: var(--logo-margin, 40px); height: var(--logo-tile, 72px);
    font-size: clamp(10px, 1vw, 12px); font-weight: 500; letter-spacing: clamp(.04em, .5vw, .16em); text-transform: uppercase; color: #e6e6e6;
    background: rgba(14,14,14,.55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.2); border-left: 0; }
  .page-open .topbar, .nav-open .topbar { visibility: visible; opacity: 1; pointer-events: auto; clip-path: inset(0 0 0 0); transform: none; transition-delay: 0s; }
  .topbar a { opacity: 0; transform: translateY(6px); transition: opacity .35s ease, transform .35s ease, background .2s, color .2s; }
  .page-open .topbar a, .nav-open .topbar a { opacity: 1; transform: none; transition-delay: calc(.12s + var(--i, 0) * .06s), calc(.12s + var(--i, 0) * .06s), 0s, 0s; }
  .topbar a { display: flex; align-items: center; padding: 0 clamp(14px, 2.2vw, 30px); color: #e6e6e6; white-space: nowrap;
    border-right: 1px solid rgba(255,255,255,.2); transition: background .2s, color .2s; }
  .topbar a:hover { background: rgba(255,255,255,.12); color: #fff; }
  .topbar a.on { background: #d6dedb; color: #161616; }

  main { position: relative; z-index: 3; padding: var(--top-pad, 144px) clamp(28px, 4vw, 56px) 0; pointer-events: none; width: 100%; }
  .card { position: relative; width: 100%; max-width: 680px; margin: 0 0 0 auto; transform: translateZ(0); pointer-events: auto; display: flex; flex-direction: column; min-height: 0;
    background: rgba(18,18,18,var(--glass-alpha, .42)); backdrop-filter: blur(var(--glass-blur, 22px)) saturate(1.2); -webkit-backdrop-filter: blur(var(--glass-blur, 22px)) saturate(1.2);
    border: 1px solid rgba(255,255,255,.18); }
  /* page header: a small box of its own above the window (tag line, title cell, subtitle cell) */
  .pagehead { position: absolute; left: 0; bottom: 100%; margin-bottom: 18px; z-index: 3; pointer-events: none; }
  .pagehead .tag { display: flex; align-items: center; gap: 8px; margin: 0 0 8px 1px; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: rgb(var(--ui, 255 175 68)); white-space: nowrap; }
  .pagehead .tag i { display: block; width: 5px; height: 5px; background: currentColor; }
  .pagehead .hbox { display: inline-flex; align-items: stretch; height: calc(var(--logo-tile, 64px) * .72); max-width: 100%;
    background: rgba(14,14,14,.55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.2); }
  .pagehead h1 { display: flex; align-items: center; padding: 0 clamp(14px, 1.5vw, 22px); }
  .pagehead .eyebrow { display: flex; align-items: center; padding: 0 clamp(14px, 1.5vw, 22px); border-left: 1px solid rgba(255,255,255,.2); }
  .pagehead { visibility: hidden; opacity: 0; transform: translateY(-8px); transition: opacity .4s ease, transform .5s cubic-bezier(.2,.7,.2,1), visibility 0s linear .5s; }
  .page-open .pagehead { visibility: visible; opacity: 1; transform: none; transition-delay: .12s, .12s, 0s; }
  html.card-gone .pagehead { display: none; }
  .pagehead.swap { animation: viewIn .5s .1s cubic-bezier(.2,.7,.2,1) both; }
  #view { --pad: clamp(22px, 2.4vw, 36px); padding: var(--pad); overflow: auto; min-height: 0; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.25) transparent; }
  /* window: wipes down from the top when a page opens and back up when you return to the index (which is just the structure and the floating menu) */
  .card { visibility: hidden; opacity: 0; pointer-events: none; transform: translateY(-14px) translateZ(0); clip-path: inset(-40px -40px 100% -40px);
    transition: clip-path .65s cubic-bezier(.2,.7,.2,1), transform .65s cubic-bezier(.2,.7,.2,1), opacity .4s ease, visibility 0s linear .65s; }
  .page-open .card { visibility: visible; opacity: 1; pointer-events: auto; transform: translateZ(0); clip-path: inset(-40px); transition-delay: 0s; }
  html.card-gone .card { display: none; }                                         /* out of the layout once the closing wipe has finished */
  #view.swap { animation: viewIn .5s .18s cubic-bezier(.2,.7,.2,1) both; }       /* content fades up whenever the page changes */
  @keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
  @media (prefers-reduced-motion: reduce) { .card, .topbar, .topbar a { transition: none !important; } #view.swap { animation: none; } }
  footer { pointer-events: none; }
  html:not(.page-open) footer { position: fixed; left: 0; right: 0; bottom: 0; padding: 0 clamp(28px, 4vw, 56px) 34px; }   /* bottom texts stay put on the index */
  @media (min-width: 901px) {                                                    /* desktop: the window is pinned bottom-right, scrolling inside itself */
    main { position: fixed; left: var(--win-l, 119px); top: var(--win-t, 233px); width: var(--win-w, 41vw); bottom: 36px; padding: 0; display: flex; align-items: flex-start; justify-content: flex-start; }
    .card { width: 100%; height: var(--win-h, 58vh); max-width: none; max-height: 100%; margin: 0; }   /* the same box on every page; content scrolls inside */
    html footer { position: fixed; left: 0; right: 0; bottom: 0; padding: 0 clamp(28px, 4vw, 56px) 34px; }   /* (html prefix: beats the base footer rule further down) */
  }
  h1 { margin: 0; font: 600 clamp(15px, 1.5vw, 21px)/1.1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: #f4f4f4; white-space: nowrap; }
  .eyebrow { font-size: 10px; letter-spacing: .2em; white-space: nowrap; color: #bcbcbc; text-transform: uppercase; }
  .intro { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; margin-top: 22px; }
  .intro p { margin: 0; flex: 1 1 320px; min-width: 0; font-size: clamp(13px, 1.1vw, 16px); line-height: 1.6; color: #b0b0b0; max-width: 520px; text-wrap: pretty; }
  .foot-meta { display: flex; justify-content: space-between; gap: 18px; padding-top: 22px; font-size: 10px; letter-spacing: .24em; text-transform: uppercase; color: #b9b9b9; }
  .meta { font-size: 10px; letter-spacing: .22em; color: #c6c6c6; text-transform: uppercase; display: grid; gap: 7px; justify-items: start; }
  .rows { display: grid; margin-top: clamp(24px, 4vh, 44px); }
  .row { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 18px; padding: 15px 0; border-top: 1px solid rgba(255,255,255,.1);
    font-size: 10px; letter-spacing: .24em; text-transform: uppercase; color: #c6c6c6; transition: color .25s, padding-left .35s; }
  .row:last-child { border-bottom: 1px solid rgba(255,255,255,.1); }
  .row:hover { color: #fff; padding-left: 14px; }
  .row .t { font-size: clamp(15px, 1.7vw, 23px); letter-spacing: .01em; text-transform: none; }
  footer { position: relative; z-index: 6; display: flex; align-items: center; gap: clamp(22px, 4vw, 52px); padding: 44px clamp(28px, 4vw, 56px);
    font-size: 10px; letter-spacing: .22em; text-transform: uppercase; color: #c6c6c6; }
  footer i { display: block; width: 5px; height: 5px; background: #6a6a6a; }
  footer span { display: flex; align-items: center; gap: 9px; }

  /* sub pages */
  .lead { margin: 0; font-size: clamp(13px, 1.1vw, 16px); line-height: 1.7; color: #b0b0b0; max-width: 620px; text-wrap: pretty; }
  .kv { display: grid; grid-template-columns: 150px 1fr; gap: 18px; padding: 14px 0; border-top: 1px solid rgba(255,255,255,.1);
    font-size: 10px; letter-spacing: .24em; text-transform: uppercase; color: #9a9a9a; align-items: baseline; }
  .kv:last-child { border-bottom: 1px solid rgba(255,255,255,.1); }
  .kv .v { font-size: clamp(14px, 1.4vw, 19px); letter-spacing: .01em; text-transform: none; color: #e6e6e6; }
  .kv .v a { border-bottom: 1px solid rgba(255,255,255,.3); }
  .kv .v a:hover { border-color: #fff; }
  .section { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; margin: 40px 0 16px; padding-bottom: 14px; border-bottom: 1px solid rgba(255,255,255,.12); }
  .section:first-of-type { margin-top: 28px; }
  .section h2 { margin: 0; font: 400 clamp(15px, 1.5vw, 20px)/1.2 var(--mono); letter-spacing: .02em; color: #ededed; }
  .section span, .section a { font-size: 10px; letter-spacing: .24em; text-transform: uppercase; color: #9a9a9a; white-space: nowrap; }
  .section a:hover { color: #fff; }
  .grid { columns: 3 220px; column-gap: 14px; }
  .shot { position: relative; display: block; margin: 0 0 14px; break-inside: avoid; background: #111; border: 1px solid rgba(255,255,255,.08); cursor: zoom-in; overflow: hidden; padding: 0; width: 100%; }
  .shot img { display: block; width: 100%; height: auto; filter: grayscale(.35) brightness(.88); transition: filter .35s, transform .6s cubic-bezier(.2,.7,.2,1); }
  .shot:hover img { filter: none; transform: scale(1.03); }
  .shot i { position: absolute; left: 8px; top: 8px; font: 400 10px/1 var(--mono); font-style: normal; letter-spacing: .12em; color: rgba(255,255,255,.75); background: rgba(0,0,0,.55); padding: 4px 6px; }
  .watch { display: inline-block; margin: -6px 0 14px; font-size: 10px; letter-spacing: .24em; text-transform: uppercase; color: #bdbdbd; border-bottom: 1px solid rgba(255,255,255,.25); }
  .watch:hover { color: #fff; border-color: #fff; }
  @media (max-width: 640px) { .kv { grid-template-columns: 1fr; gap: 6px; } }

  /* lightbox */
  #lb { position: fixed; inset: 0; z-index: 60; display: none; align-items: center; justify-content: center; background: rgba(12,12,12,.94); }
  #lb.on { display: flex; }
  #lb { touch-action: none; }
  #lb img { user-select: none; -webkit-user-drag: none; }
  #lb img { max-width: 90vw; max-height: 82vh; box-shadow: 0 0 0 1px rgba(255,255,255,.12); }
  #lb .bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; padding: 22px clamp(24px, 4vw, 56px);
    font-size: 10px; letter-spacing: .24em; text-transform: uppercase; color: #bdbdbd; }
  #lb button { all: unset; cursor: pointer; font: 400 10px/1 var(--mono); letter-spacing: .24em; text-transform: uppercase; color: #cfcfcf; padding: 10px 12px; }
  #lb button:hover { color: #fff; }
  #lb .x { position: absolute; top: 14px; right: clamp(16px, 3vw, 40px); }
  #lb .p, #lb .n { position: absolute; top: 50%; transform: translateY(-50%); font-size: 18px; }
  #lb .p { left: 8px; } #lb .n { right: 8px; }

  /* floating nav links: same language as the overlay readouts */
  #links { position: fixed; inset: 0; z-index: 7; pointer-events: none; }
  #linklines { position: fixed; inset: 0; z-index: 2; pointer-events: none; }   /* under the card, so leaders tuck behind it */
  #linklines svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
  .flink { position: absolute; left: 0; top: 0; pointer-events: auto; white-space: nowrap; will-change: transform;
    padding: 10px 10px; margin: -10px -10px;                       /* generous touch target */
    font: 400 var(--link-size, 14px)/1.2 var(--mono); letter-spacing: .1em; text-transform: uppercase;
    color: var(--link-color, #ffaf44); transition: color .2s; }
  .flink::before { content: ''; display: inline-block; width: .42em; height: .42em; background: currentColor; margin-right: .7em; vertical-align: .08em; }
  .flink { transition: color .2s, background .25s, text-shadow .25s; }
  .flink::before { transition: transform .25s cubic-bezier(.2,.7,.2,1), box-shadow .25s; }
  .flink:hover, .flink:focus-visible { color: #fff; outline: none; text-shadow: 0 0 14px var(--link-color);
    background: linear-gradient(90deg, color-mix(in srgb, var(--link-color) 20%, transparent), transparent 85%); }
  .flink:hover::before, .flink:focus-visible::before { transform: scale(1.6); box-shadow: 0 0 10px 1px var(--link-color); }
  .flink:not(.on)::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: 6px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .35s cubic-bezier(.2,.7,.2,1); }
  .flink:hover::after, .flink:focus-visible::after { transform: scaleX(1); }
  .flink.on { color: #fff; }
  .flink.on::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: 6px; height: 1px; background: currentColor; }

  @media (max-width: 900px) {
    main { padding: var(--top-pad, 76px) 14px 0; min-height: auto; }
    .card { max-width: 100%; }
    #view { --pad: 20px; }
    .pagehead { position: static; margin: 0 0 14px; width: 100%; }
    .pagehead .hbox { display: flex; width: 100%; }
    .pagehead h1 { flex: none; }
    .pagehead .eyebrow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; display: block; line-height: calc(var(--logo-tile, 64px) * .72 - 2px); letter-spacing: .1em; padding: 0 12px; }
    .topbar { right: var(--logo-margin, 40px); max-width: none; }   /* fill the row up to the right margin */
    .topbar a { flex: 1 1 0; justify-content: center; padding: 0 4px; }
    .row { grid-template-columns: 32px 1fr auto; gap: 12px; }
    .intro { gap: 18px; margin-top: 20px; }
    .frame { inset: 8px; }
    footer { padding: 28px 18px; flex-wrap: wrap; }
    html:not(.page-open) footer { padding: 0 26px 28px; }
  }

  /* corner logo on a black square tile */
  .corner-logo { position: fixed; left: var(--logo-margin, 48px); top: var(--logo-margin, 48px); z-index: 10;
    display: flex; align-items: center; justify-content: center; width: var(--logo-tile, 72px); height: var(--logo-tile, 72px);
    background: rgba(0, 0, 0, var(--logo-bg-alpha, .8)); color: rgb(var(--logo-rgb, 237 237 237) / var(--logo-alpha, .95)); transition: opacity .2s;
    border: 1px solid rgba(255,255,255,.2); }
  .corner-logo:hover { opacity: .75; }
  .corner-logo svg { display: block; height: var(--logo-size, 40px); width: auto; }


/* ---- additions for Phantom pages ---- */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.p-edit { position: fixed; right: 30px; bottom: 56px; z-index: 12; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  background: rgba(14,14,14,.7); border: 1px solid rgba(255,255,255,.2); color: #cfcfcf; font-size: 15px; }
.p-edit:hover { color: #fff; background: rgba(255,255,255,.14); }
.p-note { margin: 0 0 18px; font-size: 12px; letter-spacing: .06em; color: #b0b0b0; }
.p-entry { padding: 18px 0; border-top: 1px solid rgba(255,255,255,.1); }
.p-entry:first-child { border-top: 0; padding-top: 0; }
.p-entry h2 { margin: 0 0 10px; font: 400 clamp(16px, 1.6vw, 22px)/1.25 var(--mono); }
.p-entry h2 a:hover { text-decoration: underline; text-underline-offset: 4px; }
.p-meta { display: flex; gap: 14px; margin-bottom: 8px; font-size: 10px; letter-spacing: .22em; text-transform: uppercase; color: #9a9a9a; }
.p-more { font-size: 10px; letter-spacing: .24em; text-transform: uppercase; color: #bdbdbd; border-bottom: 1px solid rgba(255,255,255,.25); }
.p-more:hover { color: #fff; border-color: #fff; }
.p-cats, .p-pages { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; }
.p-pages { margin: 24px 0 0; justify-content: center; }
.p-cats a, .p-pages a { padding: 8px 12px; font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: #cfcfcf; border: 1px solid rgba(255,255,255,.2); }
.p-cats a:hover, .p-pages a:hover { background: rgba(255,255,255,.12); color: #fff; }
.p-cats a.on, .p-pages a.on { background: #d6dedb; color: #161616; border-color: #d6dedb; }
.p-search { display: flex; gap: 8px; margin: 0 0 22px; }
.p-search input { flex: 1; min-width: 0; padding: 12px 14px; font: 400 13px var(--mono); color: #e6e6e6; background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.2); }
.p-search button { padding: 0 18px; font: 500 10px var(--mono); letter-spacing: .2em; text-transform: uppercase; color: #161616; background: #d6dedb; border: 0; cursor: pointer; }
