/* Archive --------------------------------------------------------------- */

.page-head{
  margin-top:clamp(8px,2vh,20px);flex-shrink:0;
  display:flex;align-items:flex-end;justify-content:space-between;
  flex-wrap:wrap;gap:14px;
  padding-right:64px; /* keep clear of the menu button */
}

.tabs{display:flex;gap:10px;opacity:0;animation:rise 1.1s var(--ease) 1s forwards}
.tab{
  font-family:var(--sans);
  font-size:10.5px;letter-spacing:.26em;text-transform:uppercase;font-weight:500;
  color:var(--dim);background:transparent;cursor:pointer;
  padding:11px 22px;border:1px solid var(--line);border-radius:999px;
  transition:color .35s,border-color .35s,background .35s,box-shadow .35s;
}
.tab.is-active{
  color:var(--gold);border-color:rgba(245,201,123,.5);
  background:rgba(245,201,123,.07);box-shadow:0 0 22px rgba(245,201,123,.12);
}
.tab:hover:not(.is-active){color:var(--star);border-color:rgba(159,210,239,.4)}

.stage{
  position:relative;flex:1;min-height:0;
  width:100%;max-width:1150px;align-self:center;
  margin-top:clamp(12px,2.2vh,22px);
}
.view{
  position:absolute;inset:0;display:flex;flex-direction:column;
  opacity:0;pointer-events:none;transform:translateY(10px);
  transition:opacity .45s ease,transform .45s ease;
}
.view.is-active{opacity:1;pointer-events:auto;transform:translateY(0)}
.view .scroll-pane{flex:1;min-height:0;padding:4px 14px 24px 4px}

/* Writing --------------------------------------------------------------- */

.post{
  position:relative;display:block;overflow:hidden;
  padding:20px 24px;margin-bottom:14px;border-radius:14px;
  background:rgba(7,10,22,.62);border:1px solid rgba(159,210,239,.16);
  backdrop-filter:blur(8px);text-decoration:none;color:inherit;cursor:pointer;
  opacity:0;animation:card-in .65s var(--ease) forwards;
  transition:border-color .35s,box-shadow .35s,transform .35s;
}
.post::before{
  content:"✦";position:absolute;left:24px;top:22px;
  font-size:11px;color:rgba(245,201,123,.5);
  transition:color .35s,text-shadow .35s;
}
.post:hover{
  border-color:rgba(245,201,123,.4);transform:translateY(-2px);
  box-shadow:0 8px 40px rgba(2,4,10,.6),0 0 30px rgba(245,201,123,.08);
}
.post:hover::before{color:var(--gold);text-shadow:0 0 12px rgba(245,201,123,.8)}
.post-date{
  display:block;padding-left:24px;margin-bottom:6px;
  font-size:9px;letter-spacing:.3em;text-transform:uppercase;
  color:rgba(234,242,255,.42);
}
.post-title{
  padding-left:24px;margin-bottom:7px;
  font-family:var(--serif);font-style:italic;font-weight:600;
  font-size:clamp(19px,1.8vw,23px);line-height:1.25;color:var(--star);
  transition:color .35s;
}
.post:hover .post-title{color:var(--gold)}
.post-excerpt{
  padding-left:24px;max-width:72ch;
  font-size:12px;font-weight:300;line-height:1.65;color:var(--dim);
}
.post-more{
  display:block;padding-left:24px;margin-top:10px;
  font-size:9px;letter-spacing:.26em;text-transform:uppercase;
  color:rgba(159,210,239,.55);
}

/* Reader ---------------------------------------------------------------- */
/* Opening a post takes over the page. The archive behind it steps aside so
   only the masthead, the menu and the stars remain. */

body.reader-open .page-head,
body.reader-open .stage{
  opacity:0;pointer-events:none;
  transition:opacity .35s ease;
}
body.reader-open header{position:relative;z-index:60}

.reader{
  position:fixed;inset:0;z-index:50;display:flex;justify-content:center;
  overscroll-behavior:contain;
  background:rgba(4,6,14,.45);
  opacity:0;pointer-events:none;overflow-y:auto;
  transition:opacity .45s ease;
}
.reader.is-open{opacity:1;pointer-events:auto}
.reader-inner{
  position:relative;width:min(700px,92vw);
  padding:clamp(118px,17vh,164px) 0 96px;
}
.reader-panel{position:relative}
/* Soft pool of darkness so the text stays readable over the stars. */
.reader-inner::before{
  content:"";position:absolute;inset:-50px -70px;z-index:-1;pointer-events:none;
  background:radial-gradient(ellipse at 50% 42%,rgba(4,6,14,.92) 0%,
    rgba(4,6,14,.82) 48%,rgba(4,6,14,.45) 78%,rgba(4,6,14,0) 100%);
}
.reader-back{
  position:fixed;z-index:56;cursor:pointer;
  top:calc(var(--pad) + 58px);left:var(--pad);
  display:inline-flex;align-items:center;gap:9px;
  padding:10px 20px;border-radius:999px;
  background:rgba(4,6,14,.55);border:1px solid rgba(159,210,239,.28);
  backdrop-filter:blur(6px);
  font-family:var(--sans);font-size:9.5px;font-weight:400;
  letter-spacing:.26em;text-transform:uppercase;color:var(--cyan);
  opacity:0;transform:translateY(-6px);pointer-events:none;
  transition:opacity .4s ease,transform .4s var(--ease),color .3s,border-color .3s,box-shadow .3s;
}
body.reader-open .reader-back{opacity:1;transform:translateY(0);pointer-events:auto}
.reader-back:hover{
  color:var(--gold);border-color:rgba(245,201,123,.45);
  box-shadow:0 0 22px rgba(245,201,123,.15);
}
.reader-date{
  font-size:9.5px;letter-spacing:.34em;text-transform:uppercase;
  color:var(--gold);margin-bottom:14px;
}

.reader-body h1{
  position:relative;padding-bottom:18px;margin-bottom:24px;
  font-family:var(--serif);font-style:italic;font-weight:600;
  font-size:clamp(30px,4vw,44px);line-height:1.15;color:var(--star);
}
.reader-body h1::after{
  content:"";position:absolute;left:0;bottom:0;width:72px;height:1px;
  background:linear-gradient(90deg,var(--gold),transparent);
}
.reader-body h1 + p::first-letter{
  float:left;margin:5px 11px 0 0;
  font-family:var(--serif);font-style:italic;font-weight:600;
  font-size:3.4em;line-height:.82;color:var(--gold);
}
.reader-body h2,.reader-body h3{
  margin:28px 0 12px;
  font-family:var(--serif);font-style:italic;font-weight:600;
  font-size:clamp(20px,2.4vw,26px);color:var(--gold);
}
.reader-body p{
  margin-bottom:16px;
  font-size:14.5px;font-weight:300;line-height:1.85;
  color:rgba(234,242,255,.8);
}
.reader-body ul,.reader-body ol{margin:0 0 16px 22px}
.reader-body li{font-size:14px;font-weight:300;line-height:1.8;color:rgba(234,242,255,.76)}
.reader-body p,.reader-body li{text-shadow:0 2px 16px rgba(2,4,10,.95)}
.reader-body h1,.reader-body h2,.reader-body h3{text-shadow:0 2px 20px rgba(2,4,10,.95)}
.reader-body a{color:var(--cyan);text-decoration:none;border-bottom:1px solid rgba(159,210,239,.4)}
.reader-body em{font-style:italic;color:var(--gold)}
.reader-body strong{font-weight:500;color:var(--star)}
.reader-body img{
  max-width:100%;margin:6px 0 18px;border-radius:14px;
  border:1px solid rgba(234,242,255,.08);box-shadow:0 12px 36px rgba(2,4,10,.6);
}
.reader-body hr{
  border:none;height:1px;width:130px;margin:28px auto;
  background:linear-gradient(90deg,transparent,rgba(245,201,123,.5),transparent);
}
.reader-body blockquote{
  margin:0 0 16px;padding:4px 0 4px 18px;
  border-left:2px solid rgba(245,201,123,.5);
}
.reader-body blockquote p{
  font-family:var(--serif);font-style:italic;font-size:17px;
  color:rgba(234,242,255,.72);
}
.reader-body code{
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12.5px;
  background:rgba(159,210,239,.1);color:var(--cyan);
  padding:2px 7px;border-radius:5px;
}
.reader-body pre{
  position:relative;overflow-x:auto;
  margin-bottom:18px;padding:40px 20px 18px;border-radius:12px;
  background:linear-gradient(180deg,rgba(11,15,30,.96),rgba(6,9,20,.96));
  border:1px solid rgba(159,210,239,.22);
  box-shadow:0 10px 34px rgba(2,4,10,.55),inset 0 1px 0 rgba(234,242,255,.05);
}
.reader-body pre::before{
  content:"";position:absolute;top:14px;left:17px;
  width:10px;height:10px;border-radius:50%;background:var(--gold);opacity:.85;
  box-shadow:18px 0 0 var(--cyan),36px 0 0 var(--violet);
}
.reader-body pre code{
  background:none;padding:0;color:#d6e4f5;font-size:12.5px;line-height:1.75;
}
.hljs-keyword,.hljs-built_in,.hljs-selector-tag{color:var(--gold)}
.hljs-string,.hljs-attr{color:var(--cyan)}
.hljs-comment,.hljs-quote{color:rgba(234,242,255,.35);font-style:italic}
.hljs-number,.hljs-literal,.hljs-symbol{color:var(--violet)}
.hljs-function,.hljs-title{color:var(--teal)}
.hljs-params,.hljs-variable{color:var(--star)}

/* Logbook --------------------------------------------------------------- */

.filters{display:flex;gap:9px;margin-bottom:4px;flex-wrap:wrap}
.filter{
  font-size:9.5px;letter-spacing:.22em;text-transform:uppercase;font-weight:500;
  color:var(--dim);background:transparent;cursor:pointer;
  padding:8px 17px;border:1px solid var(--line);border-radius:999px;
  transition:color .3s,border-color .3s,background .3s;
}
.filter.is-active{
  color:var(--cyan);border-color:rgba(159,210,239,.55);background:rgba(159,210,239,.07);
}

.log-grid{
  display:grid;grid-template-columns:repeat(auto-fill,minmax(178px,1fr));
  gap:22px;padding:22px 4px 64px;
}
.tile{opacity:0;animation:card-in .6s var(--ease) forwards;transition:transform .35s var(--ease)}
.tile:hover{transform:translateY(-4px)}

.tile-poster{
  position:relative;aspect-ratio:2/3;overflow:hidden;border-radius:22px;
  border:1px solid rgba(234,242,255,.1);
  box-shadow:0 10px 30px rgba(2,4,10,.55);
  transition:box-shadow .4s,border-color .4s;
}
.tile:hover .tile-poster{
  border-color:rgba(245,201,123,.42);
  box-shadow:0 14px 40px rgba(2,4,10,.65),0 0 30px rgba(245,201,123,.16);
}
.tile-poster img{
  position:absolute;inset:0;display:block;width:100%;height:100%;
  object-fit:cover;transition:transform .5s ease;
}
.tile:hover .tile-poster img{transform:scale(1.05)}
.tile-poster--book{background:linear-gradient(160deg,#221a40,#4e3a78)}
.tile-poster--film{background:linear-gradient(160deg,#101f3e,#3a5578)}
.tile-poster--series{background:linear-gradient(160deg,#2e1a34,#78406a)}
.tile-placeholder{
  position:absolute;inset:0;display:flex;align-items:center;justify-content:center;
  padding-left:.5em;
  font-size:12px;font-weight:300;letter-spacing:.5em;text-transform:uppercase;
  color:rgba(234,242,255,.32);
}
.tile-tag{
  position:absolute;top:12px;left:12px;z-index:2;
  padding:5px 11px;border-radius:999px;
  background:rgba(4,6,14,.68);border:1px solid rgba(159,210,239,.3);
  backdrop-filter:blur(4px);
  font-size:7.5px;font-weight:500;letter-spacing:.24em;text-transform:uppercase;
  color:var(--cyan);
}
.tile-body{padding:13px 5px 0}
.tile-title{
  font-family:var(--serif);font-style:italic;font-weight:600;
  font-size:17px;line-height:1.2;color:var(--star);margin-bottom:2px;
}
.tile-creator{font-size:10px;font-weight:300;color:rgba(234,242,255,.5);margin-bottom:6px}
.tile-rating{font-size:10.5px;letter-spacing:3px;margin-bottom:6px}
.tile-rating .is-filled{
  display:inline-block;color:var(--gold);
  text-shadow:0 0 8px rgba(245,201,123,.6);
  animation:star-twinkle 2.6s ease-in-out infinite;
}
.tile-rating .is-empty{color:rgba(234,242,255,.18)}
.tile-note{
  font-size:10.5px;font-weight:300;font-style:italic;line-height:1.55;
  color:rgba(234,242,255,.5);margin-bottom:5px;
}
.tile-date{font-size:8px;letter-spacing:.24em;text-transform:uppercase;color:rgba(234,242,255,.3)}

@keyframes card-in{
  from{opacity:0;transform:translateY(16px) scale(.97)}
  to{opacity:1;transform:translateY(0) scale(1)}
}
@keyframes star-twinkle{
  0%,100%{opacity:.65;transform:scale(.94)}
  50%{opacity:1;transform:scale(1.08);text-shadow:0 0 14px rgba(245,201,123,.9)}
}

@media (max-width:720px){
  .page-head{padding-right:56px}
  .log-grid{grid-template-columns:repeat(2,1fr);gap:12px;padding:16px 0 40px}
  .tile-poster{border-radius:15px}
  .tile-tag{top:8px;left:8px;font-size:7px;padding:4px 9px}
  .tile-body{padding:9px 3px 0}
  .tile-title{font-size:13.5px}
  .tile-creator{font-size:8.5px;margin-bottom:4px}
  .tile-rating{font-size:9px;letter-spacing:2px;margin-bottom:4px}
  .tile-note{font-size:9px;line-height:1.45;margin-bottom:3px}
  .tile-date{font-size:7px}
  .reader-back{top:calc(var(--pad) + 46px);left:16px;padding:9px 16px;font-size:9px}
  .reader-inner{padding-top:112px}
  [data-theme="light"] .reader-panel{padding:22px 18px 72px;border-radius:24px}
}

/* Day mode ------------------------------------------------------------- */
[data-theme="light"] .post,
[data-theme="light"] .tile-poster{
  background:var(--panel);border-color:rgba(42,126,166,.2);
  box-shadow:0 8px 26px rgba(18,53,75,.12);
}
[data-theme="light"] .post:hover{
  border-color:rgba(181,118,28,.45);
  box-shadow:0 10px 34px rgba(18,53,75,.16);
}
[data-theme="light"] .tile-poster--book{background:linear-gradient(160deg,#CFE3F2,#9FC2DE)}
[data-theme="light"] .tile-poster--film{background:linear-gradient(160deg,#CFEAF2,#8FC6D8)}
[data-theme="light"] .tile-poster--series{background:linear-gradient(160deg,#EBDCEF,#C6A9D6)}
[data-theme="light"] .tile-placeholder{color:rgba(18,53,75,.42)}
[data-theme="light"] .tile-tag{background:rgba(255,255,255,.82);border-color:rgba(42,126,166,.3)}
[data-theme="light"] .reader{background:rgba(223,240,247,.62)}
[data-theme="light"] .reader-inner{
  width:min(820px,92vw);
  padding:clamp(118px,17vh,164px) 0 0;
}
[data-theme="light"] .reader-panel{
  position:relative;
  padding:clamp(28px,3vw,36px) clamp(26px,3.2vw,40px) 96px;
  background:linear-gradient(180deg,rgba(255,255,255,.54),rgba(255,255,255,.42));
  border:1px solid rgba(255,255,255,.52);
  border-radius:32px;
  box-shadow:0 24px 60px rgba(18,53,75,.10);
  backdrop-filter:blur(12px) saturate(1.05);
  overflow:hidden;
}
[data-theme="light"] .reader-inner::before{
  inset:-26px -26px;
  background:radial-gradient(ellipse at 50% 28%,rgba(255,255,255,.34) 0%,
    rgba(255,255,255,.18) 45%,rgba(255,255,255,.05) 70%,rgba(255,255,255,0) 100%);
}
[data-theme="light"] .reader-body,
[data-theme="light"] .reader-date{
  position:relative;
  z-index:1;
}
[data-theme="light"] .reader-body p{color:rgba(18,53,75,.86);text-shadow:none}
[data-theme="light"] .reader-body li{color:rgba(18,53,75,.82);text-shadow:none}
[data-theme="light"] .reader-body h1,
[data-theme="light"] .reader-body h2,
[data-theme="light"] .reader-body h3{color:var(--star);text-shadow:0 1px 10px rgba(255,255,255,.55)}
[data-theme="light"] .reader-back{
  background:rgba(255,255,255,.72);border-color:rgba(42,126,166,.3);
}
[data-theme="light"] .reader-body code{background:rgba(42,126,166,.12);color:#1c5f7e}
[data-theme="light"] .post-more{color:rgba(42,126,166,.8)}
[data-theme="light"] .tile-note{color:rgba(18,53,75,.62)}
[data-theme="light"] .tile-creator{color:rgba(18,53,75,.6)}
[data-theme="light"] .tile-date,
[data-theme="light"] .post-date{color:rgba(18,53,75,.5)}
[data-theme="light"] .post-excerpt{color:rgba(18,53,75,.74)}
[data-theme="light"] .post-title{color:var(--star)}
[data-theme="light"] .reader-date{color:var(--gold)}
[data-theme="light"] .tile-title{color:var(--star)}
