/* bun's calendar — dressed like the garden: blue-black night, misty clouds, the moon, old-book letters.
 * fonts are self-hosted (see fonts/LICENSES.txt). */
@font-face{font-family:'IM Fell English';font-style:normal;font-weight:400;font-display:swap;src:url(/fonts/fell-400.woff2) format('woff2')}
@font-face{font-family:'IM Fell English';font-style:italic;font-weight:400;font-display:swap;src:url(/fonts/fell-400i.woff2) format('woff2')}
@font-face{font-family:'Spectral';font-style:normal;font-weight:400;font-display:swap;src:url(/fonts/spectral-400.woff2) format('woff2')}
@font-face{font-family:'Spectral';font-style:italic;font-weight:400;font-display:swap;src:url(/fonts/spectral-400i.woff2) format('woff2')}
@font-face{font-family:'Spectral';font-style:normal;font-weight:600;font-display:swap;src:url(/fonts/spectral-600.woff2) format('woff2')}
@font-face{font-family:'Reenie Beanie';font-style:normal;font-weight:400;font-display:swap;src:url(/fonts/reenie.woff2) format('woff2')}

:root{
  color-scheme:dark;
  --bg:#06070a; --bg2:#0b0d12; --bed:#12151c; --line:#1a1e28; --line2:#2b3140;
  --text:#b8bbc5; --moon:#e9e7de; --dim:#858b9b; --faint:#6e7486; --ghost:#4a5060;
  --accent:#a9b2cc; --accent-deep:#1e2336; --rose:#bf90aa; --rose-deep:#2a1c26;
  --red:#d98585;          /* weekends, like a paper calendar */
  --f-display:'IM Fell English','Iowan Old Style',Georgia,serif;
  --f-body:'Spectral',Georgia,'Times New Roman',serif;
  --f-hand:'Reenie Beanie','Segoe Print','Bradley Hand',cursive;
  --w:68rem;
  --noise:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

/* ───────── base ───────── */
*,*::before,*::after{box-sizing:border-box}
html{background:var(--bg);-webkit-text-size-adjust:100%}
body{margin:0;min-height:100vh;display:flex;flex-direction:column;position:relative;background:var(--bg);color:var(--text);font:400 1.06rem/1.6 var(--f-body);overflow-x:hidden}
body::after{content:'';position:fixed;inset:0;z-index:200;pointer-events:none;background-image:var(--noise);opacity:.04}
[hidden]{display:none !important}
::selection{background:var(--accent-deep);color:var(--moon)}
a{color:var(--accent);text-underline-offset:.22em;text-decoration-thickness:1px}
a:hover{color:var(--moon)}
button{font:inherit;color:inherit}
:focus-visible{outline:2px solid var(--accent);outline-offset:3px;border-radius:3px}
h1,h2{font-family:var(--f-display);font-weight:400;color:var(--moon);margin:0}
.hand{font-family:var(--f-hand);font-size:1.5rem;line-height:1;color:var(--dim)}

/* ───────── the night sky (same as the garden's) ───────── */
#sky{position:absolute;top:0;left:0;right:0;height:clamp(520px,90vh,900px);z-index:0;pointer-events:none;overflow:hidden;
  background:var(--bg) url(/art/sky.svg) no-repeat 50% 20%/cover}
#sky::after{content:'';position:absolute;inset:0;z-index:1;
  background:linear-gradient(90deg,rgb(6 7 10/.55),rgb(6 7 10/0) 62%),linear-gradient(180deg,rgb(6 7 10/.12) 0%,rgb(6 7 10/.2) 40%,#06070a 100%)}

/* ───────── header ───────── */
.top{position:relative;z-index:1;width:100%;max-width:var(--w);margin:0 auto;padding:1.4rem 1.25rem 0}
.top-in{display:flex;justify-content:space-between;align-items:center;gap:1rem}
.brand{display:flex;align-items:center;gap:.9rem;text-decoration:none;color:inherit;min-width:0}
.brand-moon{width:52px;height:52px;flex:none;display:block}
.brand-text{display:flex;flex-direction:column;min-width:0}
.brand-text b{font:400 1.85rem/1.05 var(--f-display);color:var(--moon);letter-spacing:.01em}
.brand-text small{font:italic .98rem/1.3 var(--f-body);color:var(--dim);margin-top:.15rem}
.brand:hover b{color:#fff}
.sky-note{font:1.45rem/1 var(--f-hand);color:var(--dim);white-space:nowrap}

/* ───────── page ───────── */
main{position:relative;z-index:1;flex:1;width:100%;max-width:var(--w);margin:0 auto;padding:2.2rem 1.25rem 2rem}
.hero{padding:2.4rem 0 1.6rem}
.nowline{position:relative;z-index:2;display:flex;align-items:baseline;gap:.4rem 1rem;flex-wrap:wrap}
.nowline .hand{color:var(--accent)}
.title-row{display:flex;align-items:flex-end;justify-content:space-between;gap:1rem 2rem;flex-wrap:wrap;margin-top:.6rem}
.steps{position:relative;z-index:2}
h1{font:italic 400 clamp(3.4rem,9vw,6.2rem)/.95 var(--f-display);padding-bottom:.2em;margin-bottom:-.05em;color:var(--moon);letter-spacing:-.01em;text-shadow:0 0 .8em rgba(0,0,0,.5);user-select:none;-webkit-user-select:none;cursor:default}
h1 .yr{font:2.2rem/1 var(--f-hand);color:var(--rose);letter-spacing:0;vertical-align:.35em;margin-left:.15em;text-shadow:none}
.steps{display:flex;gap:.5rem;flex-wrap:wrap;padding-bottom:.6rem}
.mini{display:inline-flex;align-items:center;gap:.35rem;padding:.2rem .95rem;border:1px solid var(--line2);border-radius:999px;background:rgb(11 13 18/.6);color:var(--text);font:italic 1.02rem/1.4 var(--f-display);cursor:pointer}
.mini:hover{border-color:var(--accent);color:var(--moon)}
.editbar{display:flex;align-items:baseline;gap:.8rem;margin-top:.9rem}
.editbar .hand{color:var(--rose);font-size:1.6rem}
.link{background:none;border:0;padding:0;color:var(--accent);font:italic 1rem/1.3 var(--f-display);text-decoration:underline dotted var(--accent);text-underline-offset:.25em;cursor:pointer}
.link:hover{color:var(--moon)}

.cols{display:grid;grid-template-columns:minmax(0,1fr) 19.5rem;gap:1.6rem;align-items:start}

/* ───────── the month ───────── */
.month{background:rgb(6 7 10/.55);border:1px solid var(--line);border-radius:12px;padding:.7rem .7rem .75rem;backdrop-filter:blur(3px);-webkit-backdrop-filter:blur(3px)}
.wds{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:.4rem;margin-bottom:.45rem;text-align:center;font:italic 1rem/1 var(--f-display);color:var(--dim)}
.wds .we{color:var(--red)}
.days{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:.4rem}
.day{position:relative;min-height:6.6rem;padding:.45rem .5rem .4rem;border:1px solid var(--line);border-radius:8px;background:rgb(11 13 18/.88);text-align:left;cursor:pointer;display:flex;flex-direction:column;gap:.25rem;min-width:0;transition:border-color .15s,background .15s}
.day:hover{border-color:var(--line2);background:rgb(18 21 28/.85)}
.day.blank{background:transparent;border-color:transparent;cursor:default}
.day.other{background:rgb(11 13 18/.4);border-color:transparent}
.day.other .n{color:var(--ghost)}
.day.other.wkend .n{color:#6e4a4e}
.day.other:hover{background:rgb(18 21 28/.6);border-color:var(--line)}
.day.past .n,.day.past .chips,.day.past .more{opacity:.5}
.day.past:hover .n,.day.past:hover .chips{opacity:.85}
.day .n{font:400 1.3rem/1 var(--f-display);color:var(--dim)}
.day.wkend .n{color:var(--red)}
.day.wkend{background:rgb(24 13 17/.9)}
.day.other.wkend{background:rgb(24 13 17/.35);border-color:transparent}
.day.other.wkend .n{color:#6e4a4e}
.day.other:hover,.day.other.wkend:hover{border-color:var(--line)}
.day.today{border-color:rgb(233 231 222/.5);box-shadow:0 0 0 1px rgb(233 231 222/.1),0 0 26px rgb(214 220 242/.1)}
.day.today .n{color:var(--moon)}
.day.today .n::after{content:'today';font:1.15rem/1 var(--f-hand);color:var(--rose);margin-left:.4rem}
.day.wkend.today .n{color:var(--red)}
.day.sel{border-color:var(--accent);background:rgb(30 35 54/.85)}
.chips{display:flex;flex-direction:column;gap:.18rem;min-width:0}
.chip{display:block;font:400 .8rem/1.3 var(--f-body);color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding-left:.4rem;border-left:2px solid var(--accent)}
.chip.rem{border-left-color:var(--rose)}
.chip .t{font-style:italic;color:var(--dim);margin-right:.25rem}
.chip.locked{color:var(--dim);font-style:italic}
.chip.done{color:var(--ghost);text-decoration:line-through}
.chip.hidden{border-left-style:dashed;color:var(--dim)}
.more{font:1.05rem/1 var(--f-hand);color:var(--dim);padding-left:.5rem}

/* ───────── the diary on the side ───────── */
.diary{position:sticky;top:1.2rem;border:1px solid var(--line2);border-radius:10px;background:rgb(11 13 18/.8);padding:1.15rem 1.2rem 1.1rem}
.diary h2{font:italic 400 1.9rem/1.1 var(--f-display)}
.d-head{display:flex;align-items:baseline;justify-content:space-between;gap:.5rem 1rem;flex-wrap:wrap;margin:.35rem 0 .9rem}
.d-sub{margin:0;color:var(--accent)}
.list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}
.item{display:grid;grid-template-columns:4.1rem minmax(0,1fr);gap:.6rem;padding:.6rem 0;border-top:1px solid var(--line)}
.item:first-child{border-top:0;padding-top:.1rem}
.item .when{font:italic .95rem/1.25 var(--f-body);color:var(--dim);display:flex;flex-direction:column}
.item .when small{font-size:.88rem;color:var(--faint)}
.item .what{min-width:0}
.item .title{color:var(--text);overflow-wrap:anywhere;line-height:1.4}
.item .title::before{content:'';display:inline-block;width:6px;height:6px;border-radius:50%;background:var(--accent);margin:0 .5rem .15rem 0;vertical-align:middle}
.item.rem .title::before{background:var(--rose)}
.item.locked .title{color:var(--dim);font-style:italic}
.item.done .title{color:var(--ghost);text-decoration:line-through}
.item.wkend .when span:first-child{color:var(--red)}
.tags{display:flex;flex-wrap:wrap;gap:.35rem;margin-top:.3rem}
.tag{font:1.1rem/1 var(--f-hand);color:var(--dim)}
.tag + .tag::before{content:'· ';color:var(--ghost)}
.acts{display:flex;gap:.9rem;margin-top:.35rem}
.empty{color:var(--dim);font-style:italic;margin:0}
.add{margin-top:.9rem;width:100%;background:transparent;border:1px dashed var(--line2);color:var(--accent);border-radius:999px;padding:.4rem 0;cursor:pointer;font:italic 1.05rem/1.3 var(--f-display)}
.add:hover{border-color:var(--accent);color:var(--moon)}

/* ───────── editing + sign-in ───────── */
.editor{margin-top:.9rem;padding-top:.9rem;border-top:1px solid var(--line2);display:flex;flex-direction:column;gap:.65rem}
.kinds{display:flex;flex-direction:column;gap:.3rem;font:italic 1.02rem/1.35 var(--f-display);color:var(--text)}
.kinds small{font:1.1rem/1 var(--f-hand);color:var(--dim);margin-left:.25rem}
.kinds input{accent-color:var(--rose)}
.f{display:flex;flex-direction:column;gap:.2rem;min-width:0;flex:1}
.f > span{font:1.15rem/1 var(--f-hand);color:var(--dim)}
.row{display:flex;gap:.6rem}
input[type=text],input[type=password],input[type=date],input[type=time],select{width:100%;background:var(--bg2);border:1px solid var(--line2);border-radius:6px;color:var(--text);font:400 .95rem/1.4 var(--f-body);padding:.35rem .5rem;min-width:0}
input:focus,select:focus{outline:1px solid var(--accent);outline-offset:0;border-color:var(--accent)}
.msg{min-height:1.2em;margin:0;color:var(--rose);font-style:italic;font-size:.95rem}
.btns{display:flex;gap:.5rem;flex-wrap:wrap}
.btn{display:inline-flex;align-items:center;padding:.35rem 1.1rem;border:1px solid var(--line2);border-radius:999px;background:transparent;color:var(--text);font:italic 1.05rem/1.2 var(--f-display);cursor:pointer;transition:background .15s,border-color .15s,color .15s}
.btn:hover{border-color:var(--accent);color:var(--moon)}
.btn.pri{background:var(--accent-deep);border-color:#3a4260;color:var(--moon)}
.btn.pri:hover{background:#283050;border-color:var(--accent)}
.btn.danger{margin-left:auto}
.btn.danger:hover{background:var(--rose-deep);border-color:var(--rose);color:#efcfe2}
.gate{background:var(--bg2);color:var(--text);border:1px solid var(--line2);border-radius:12px;padding:1.4rem 1.4rem 1.2rem;width:min(22rem,calc(100vw - 2rem))}
.gate::backdrop{background:rgb(6 7 10/.75)}
.gate h2{font:italic 400 2rem/1.1 var(--f-display)}
.gate .hand{margin:.35rem 0 .8rem;font-size:1.4rem}
.gate .msg{margin:.5rem 0}
.gate.words{width:min(34rem,calc(100vw - 2rem));max-height:calc(100vh - 2rem);overflow:auto}
.wfields{display:flex;flex-direction:column;gap:.7rem;margin-bottom:.4rem}
.wfields textarea{width:100%;min-height:7.5rem;resize:vertical;background:var(--bg2);border:1px solid var(--line2);border-radius:6px;color:var(--text);font:400 .95rem/1.45 var(--f-body);padding:.45rem .55rem}
.wfields textarea:focus{outline:1px solid var(--accent);outline-offset:0;border-color:var(--accent)}

/* ───────── footer ───────── */
.foot{position:relative;z-index:1;display:flex;align-items:center;justify-content:center;gap:.7rem;padding:.4rem 1.25rem 1rem}
.sleepy{width:44px;height:44px;image-rendering:auto}
.foot-text{display:flex;align-items:baseline;gap:.4rem .9rem;flex-wrap:wrap;font:italic .95rem/1.3 var(--f-body)}
.foot-text > :not([hidden]) ~ :not([hidden])::before{content:'·';display:inline-block;color:var(--ghost);margin-right:.9rem;font:italic .95rem/1 var(--f-body);text-decoration:none}

/* ───────── big screens: the whole month fits on one screen, no scrolling ───────── */
@media (min-width:821px) and (min-height:560px){
  body{height:100vh;min-height:0}
  .top{padding-top:1rem}
  main{display:flex;flex-direction:column;min-height:0;padding-top:.6rem;padding-bottom:.4rem}
  .hero{padding:.6rem 0 .6rem}
  h1{font-size:clamp(3rem,9vh,5.4rem)}
  .cols{flex:1;min-height:0;grid-template-rows:minmax(0,1fr);align-items:stretch}
  .month{display:flex;flex-direction:column;min-height:0}
  .days{flex:1;min-height:0;grid-auto-rows:minmax(0,1fr)}
  .day{min-height:0;overflow:hidden}
  .diary{position:static;align-self:start;max-height:100%;overflow:auto;scrollbar-width:thin;scrollbar-color:var(--line2) transparent}
}

/* ───────── phones: tiles shrink to dots, the diary goes under ───────── */
@media (max-width:820px){
  .top{padding-top:1rem}
  .brand-text small{display:none}
  .sky-note{font-size:1.25rem}
  .hero{padding:1.4rem 0 1.2rem}
  .cols{grid-template-columns:minmax(0,1fr)}
  .diary{position:static}
  .days,.wds{gap:.25rem}
  .day{min-height:3.3rem;padding:.3rem .2rem;border-radius:6px;align-items:center}
  .day .n{font-size:1.1rem}
  .day.today .n::after{content:''}
  .chips{flex-direction:row;justify-content:center;flex-wrap:wrap;gap:3px}
  .chip{width:6px;height:6px;padding:0;border:0;border-radius:50%;background:var(--accent);font-size:0}
  .chip.rem{background:var(--rose)}
  .chip.locked,.chip.hidden{background:transparent;outline:1px solid var(--dim)}
  .chip.done{background:var(--ghost)}
  .more{display:none}
}
@media (prefers-reduced-motion:reduce){.day,.btn{transition:none}}
