/* Celestial Clock · Diary of Planet Earth */
.celestial-entry {
  display:flex; align-items:center; gap:clamp(1rem,3vw,1.65rem);
  position:relative; isolation:isolate; overflow:hidden;
  margin:1rem 0; padding:clamp(.95rem,3vw,1.45rem);
  border:1px solid #a89064; border-radius:.9rem;
  color:#fff4dc;
  background:radial-gradient(ellipse at 97% 11%,#932f3d7d,transparent 63%),
    linear-gradient(110deg,#300b1b 5%,#471123 44%,#691b32 78%,#4b1428);
  box-shadow:inset 0 1px #fff4da17;
}
.celestial-icon {
  display:block;flex:none;aspect-ratio:1;border-radius:21%;border:1px solid #c4b69568;
  background-color:#0c1826;
  background-image:url("../art/celestial-icon.webp"),
    radial-gradient(circle at 32% 42%,#9bb4ab 0%,#285f78 25%,#102e46 46%,#071221 55%,#0b1525 64%,#a68b59 65%,#101e2b 68%);
  background-position:center;background-size:cover;
  box-shadow:0 .2rem .65rem #0006;
}
.celestial-entry-art {width:clamp(5rem,17vw,7.25rem)}
.celestial-entry-copy {min-width:0}
.celestial-entry-copy h2 {margin:0;color:#fff2d9;font:400 clamp(1.6rem,3.7vw,2.15rem)/1.08 Georgia,serif;letter-spacing:-.025em}
.celestial-entry-copy p {margin:.35rem 0 0;color:#fff1df;font:400 .88rem/1.4 system-ui,sans-serif}
#celestial-open {display:inline-flex;align-items:center;gap:.5rem;min-height:44px;padding:0;background:none;border:0;color:#f7d9a5;font:650 .87rem/1.2 system-ui,sans-serif;cursor:pointer}
#celestial-open::after {content:"";position:absolute;inset:0}
#celestial-open span {font-size:1.16em}
#celestial-open:focus-visible,.celestial-instrument :focus-visible {outline:2px solid #ffe2a7;outline-offset:3px}
#celestial-dialog {
  box-sizing:border-box;color-scheme:dark;width:min(96%,70rem);max-width:100%;
  max-height:95vh;max-height:95dvh;margin:auto;padding:0;overflow:auto;overscroll-behavior:contain;
  color:#f9eed6;border:1px solid #837659;border-radius:1rem;
  background:radial-gradient(ellipse at 17% 48%,#102432 0%,#08121d 50%,transparent 78%),
    linear-gradient(145deg,#091522 0%,#101722 65%,#1f1823);
  box-shadow:0 1.5rem 6rem #030811aa;font:400 1rem/1.45 system-ui,sans-serif;
}
#celestial-dialog::backdrop {background:#040812d9}
.celestial-frame {padding:clamp(1rem,2.2vw,1.65rem)}
.celestial-head,.celestial-heading,.celestial-readout,.celestial-actions,.celestial-meta,.celestial-view {display:flex;align-items:center}
.celestial-head {justify-content:space-between;gap:.65rem;border-bottom:1px solid #a8956a40;padding-bottom:.8rem}
.celestial-heading {gap:clamp(.55rem,1.5vw,.88rem);min-width:0}
.celestial-head-art {width:clamp(2.6rem,5.8vw,4.1rem)}
.celestial-overline {display:block;margin:0 0 .2rem;color:#e7cfa2;font:650 .75rem/1.4 system-ui,sans-serif;letter-spacing:.13em;text-transform:uppercase}
#celestial-title {margin:0;color:#fff4df;font:400 clamp(1.72rem,4.4vw,3.05rem)/1.06 Georgia,serif;letter-spacing:-.035em}
.celestial-instrument button,.celestial-instrument select {font-family:inherit}
.celestial-close,.celestial-actions button,.celestial-site select,#celestial-tilt {
  min-height:44px;border-radius:.55rem;color:#f3ecda;border:1px solid #61717b;background:#142430;cursor:pointer;
}
.celestial-close {flex:none;padding:.3rem .76rem;font-size:.85rem}
.celestial-close span {margin-left:.18rem;color:#edcc91;font-size:1.15rem}
.celestial-deck {display:grid;grid-template-columns:minmax(0,1.75fr) minmax(14.4rem,.86fr);gap:clamp(.8rem,2.6vw,2rem);align-items:center;padding:.45rem 0 .35rem}
.celestial-sphere {min-width:0;text-align:center}
#celestial-globe {display:block;width:100%;height:auto;aspect-ratio:1;touch-action:none;cursor:grab}
#celestial-globe:active {cursor:grabbing}
.celestial-key {display:flex;flex-wrap:wrap;justify-content:center;gap:.3rem .95rem;color:#e4ded2;font-size:.76rem;line-height:1.3}
.celestial-key span {display:inline-flex;align-items:center;gap:.36rem}
.celestial-key i {display:inline-block;width:.55rem;height:.55rem;border-radius:50%}
.celestial-sun-key {background:#edbf72}
.celestial-location-key {border:2px solid #76dce1}
.celestial-view {justify-content:center;gap:.3rem .85rem;flex-wrap:wrap;margin:.2rem auto 0}
#celestial-help {margin:0;color:#bfccd2;font-size:.76rem}
#celestial-tilt {background:transparent;color:#bddce4;border:0;display:inline-flex;align-items:center;gap:.38rem;padding:.25rem .35rem;font-size:.76rem}
#celestial-tilt::before {content:"";width:.93rem;height:.48rem;border:1.5px solid currentColor;border-radius:50%;transform:rotate(-23deg)}
#celestial-tilt[aria-pressed=true] {color:#ffda9e}
#celestial-tilt[aria-pressed=true]::before {width:.8rem;height:.8rem;transform:none}
.celestial-station {min-width:0;border:1px solid #927e5a68;border-radius:.85rem;padding:clamp(.95rem,2vw,1.45rem);
  background:linear-gradient(155deg,#23303ccf,#131c28be 70%,#26202bbd)}
.celestial-readout {justify-content:space-between;align-items:flex-end;gap:.6rem;font-variant-numeric:tabular-nums}
#celestial-local,#celestial-utc,#celestial-date {display:block}
#celestial-local {color:#fff2d9;font:400 clamp(1.5rem,3.2vw,2.35rem)/1.05 Georgia,serif;font-variant-numeric:tabular-nums}
#celestial-utc {color:#b2deea;font:500 clamp(.97rem,1.8vw,1.26rem)/1.3 system-ui,sans-serif;font-variant-numeric:tabular-nums}
#celestial-date {font-size:.85rem;color:#ded3c0;margin:.45rem 0 1.15rem}
.celestial-site {border-top:1px solid #a6936e57;padding-top:.85rem}
.celestial-site select {width:100%;margin:.3rem 0 .55rem;padding:.35rem .7rem;font-size:1rem}
.celestial-meta {justify-content:space-between;gap:.25rem .65rem;flex-wrap:wrap;font-size:.75rem;color:#bcd0d7}
.celestial-actions {gap:.42rem;flex-wrap:wrap;margin-top:.85rem}
.celestial-actions button {padding:.35rem .65rem;color:#efd5a7;border-color:#85785e;font-size:.79rem}
.celestial-actions button:hover,.celestial-close:hover {background:#283b49}
#celestial-status {margin:.55rem 0 0;color:#f1d2a5;font-size:.82rem}
#celestial-status:empty {display:none}
.celestial-signature-bar {margin-top:.5rem;padding-top:.35rem;border-top:1px solid #a6936e40;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:.35rem .6rem}
.celestial-signature-bar a {display:inline-flex;align-items:center;gap:.45rem;min-height:44px;color:#eace97;text-decoration:none;font:600 .85rem/1.3 Georgia,serif;letter-spacing:.07em}
.celestial-signature-bar a:hover {text-decoration:underline}
.celestial-signature-bar img {border-radius:.3rem}
.celestial-signature-bar small {color:#bfccd1;font-size:.75rem}
.celestial-modal-open {overflow:hidden}
#celestial-dialog.celestial-fallback[open] {display:block;position:fixed;inset:0;z-index:100;box-shadow:0 0 0 100vmax #070914ce}
@media(max-width:46rem) {
  #celestial-dialog {width:100%;height:100%;height:100dvh;max-height:100%;max-height:100dvh;border:0;border-radius:0;margin:0}
  .celestial-frame {padding:max(.85rem,env(safe-area-inset-top)) max(.75rem,env(safe-area-inset-right)) max(1rem,env(safe-area-inset-bottom)) max(.75rem,env(safe-area-inset-left))}
  .celestial-deck {grid-template-columns:minmax(0,1fr);gap:.65rem}
  .celestial-sphere {width:calc(100% + .8rem);max-width:34rem;justify-self:center}
  .celestial-station {box-sizing:border-box;width:min(100%,32rem);margin:auto}
}
@media(max-width:24rem) {
  .celestial-head-art {width:2.3rem}
  .celestial-overline {letter-spacing:.09em}
  .celestial-view {gap:.25rem}
}
@media (forced-colors:active) {
  .celestial-entry,.celestial-close,.celestial-actions button,.celestial-site select,.celestial-station {border-color:ButtonText}
  #celestial-globe,.celestial-icon {forced-color-adjust:none}
}
@media(min-width:46.01rem) and (min-height:38rem) {
  #celestial-dialog {width:min(96%,70rem,max(47rem,calc(94vh + 12rem)))}
  .celestial-sphere {width:100%;max-width:max(20rem,calc(94vh - 13.7rem));justify-self:center}
}

@media not all and (forced-colors:active) {
  .celestial-entry::before {
    content:""; position:absolute; inset:0; z-index:-1; pointer-events:none;
    background:transparent url("../art/clock-engraving.webp") right 55% / auto 139% no-repeat;
    opacity:.32;
  }
  .celestial-entry-copy {text-shadow:0 1px 3px #290c17}
}
