/* Inside the journal: warm paper, engraved dividers and a pixel-art landscape. */
body:not(.at-entry) {
  --ink:#352b3a; --muted:#675767; --line:#d6bbab; --rose:#f3d9c9;
  --pink:#8a3556; --paper:#f9efd9;
  background-color:var(--paper);
  background-image:radial-gradient(#ab855631 .7px,transparent .8px);
  background-size:5px 5px;
}
.top .wrap, main.wrap { width:min(calc(100% - 36px),1000px); margin-inline:auto; }
.top { background:#fcf2df; border-bottom:2px solid #4a3849; }
.brand-mark { border-radius:0; background:transparent; color:#a83d62; text-shadow:2px 2px #ecad85; }
.hero {
  display:flex; align-items:center; min-height:clamp(200px,23vw,282px);
  padding:22px clamp(16px,4vw,48px); margin:18px 0 0; border:0; border-radius:0;
  border-bottom:4px solid #563948;
  background:#f8ce97 url(journal-garden.jpg) center / cover;
  clip-path:polygon(0 8px,8px 8px,8px 0,calc(100% - 8px) 0,calc(100% - 8px) 8px,100% 8px,100% 100%,0 100%);
}
.hero-copy { padding:12px 18px; background:#fff1cedf; border-left:4px solid #995473; }
.hero h1 { font-size:clamp(1.5rem,3.6vw,2.6rem); }
.hero-date,.event-time,.countdown [role=timer] { font-family:ui-monospace,Menlo,monospace; }
main section { margin:24px auto 0; }
.section-head { border-bottom:3px double #88697a; padding-bottom:9px; }
.section-head h2 { font-size:clamp(1.45rem,3vw,2.1rem); }
.switch,.task-filter { display:flex; gap:2px; justify-content:flex-start; background:none; padding:0; border-radius:0; border-bottom:2px solid #aa8b88; }
.switch button,.task-filter button { border:0; border-radius:0; color:#604e5a; padding-inline:14px; background:transparent; }
.switch [aria-pressed=true],.task-filter [aria-pressed=true] { color:#63263e; background:#eed3ba; box-shadow:inset 0 -4px #933c5a; }
main details,main .card,main .progress-card { border:0; border-radius:0; box-shadow:none; background:transparent; }
#timeline { border-left:3px solid #896379; margin:20px 0 0 9px; padding-left:20px; }
#timeline details { position:relative; margin-bottom:10px; }
#timeline details::before { content:''; position:absolute; width:10px; height:10px; left:-27px; top:18px; background:#fbdeb5; outline:2px solid #684056; }
#timeline details[open]::before { background:#c06276; }
main summary { padding-left:0; border-bottom:1px dashed #bd9b90; }
.events,.items { padding-inline:0; }
.event { padding:14px 0; border-top:0; border-bottom:1px dotted #c3a899; }
.event-time { color:#85415c; }
.card h3,.team-card tbody th { color:#543344; }
main .grid { display:block; }
main .card:not(.material-row) { padding:14px 0; border-bottom:2px dotted #bb9a89; }
.team-card table { background:#fffaf34d; }
.team-card thead { background:#ead6ba; }
.team-card td,.team-card th { padding:10px 8px; }
#material-list h3 { border-bottom:3px double #aa8b88; padding:8px 0; }
#material-list h4 { color:#813f58; margin:14px 0 2px; }
.material-row { padding:4px 6px; margin:0; border-bottom:1px dotted #b89989 !important; }
.progress-card { padding:12px 0; }
footer { padding-bottom:calc(118px + env(safe-area-inset-bottom)); }

/* The dock is a single shared shelf. Each link has its own pixel sprite. */
.nav,.nav.expanded {
  position:fixed; inset:auto 0 max(9px,env(safe-area-inset-bottom)); margin:auto;
  width:max-content; max-width:calc(100% - 12px); display:flex; flex-direction:row;
  gap:4px; padding:5px 9px 7px; background:#f4e3ccea;
  border:1px solid #947482; border-bottom:3px solid #775868; border-radius:21px;
  box-shadow:0 7px 17px #38263735; backdrop-filter:blur(14px); -webkit-backdrop-filter:blur(14px);
}
.nav a {
  position:relative; display:flex; flex-direction:column; justify-content:center; align-items:center;
  min-width:60px; min-height:55px; padding:1px 5px 5px; gap:0;
  font-size:.78rem; line-height:1.2; font-weight:650;
}
.nav a span {
  width:32px; height:32px; font-size:0; background:url(dock-icons.png) 0 0 / 160px 32px no-repeat;
  image-rendering:pixelated; transform-origin:bottom; transition:transform .16s ease;
}
.nav a:nth-child(2) span { background-position:-32px 0; }
.nav a:nth-child(3) span { background-position:-64px 0; }
.nav a:nth-child(4) span { background-position:-96px 0; }
.nav a:nth-child(5) span { background-position:-128px 0; }
.nav a[aria-current=page] { background:#ffeedd; color:#6a2947; }
.nav a[aria-current=page]::after { content:''; width:5px; height:3px; position:absolute; bottom:0; background:#934b69; }
@media(hover:hover) and (prefers-reduced-motion:no-preference) {
  .nav a:hover span,.nav a:focus-visible span { transform:translateY(-3px) scale(1.24); }
}
@media(max-width:560px) {
  .hero { min-height:188px; padding:12px; background-position:65% center; align-items:flex-end; }
  .hero-copy { padding:7px 10px; }
  .hero h1 { font-size:1.45rem; }
  .hero-date,.countdown { margin:2px 0; }
  .switch button { flex:1; }
  .nav,.nav.expanded { gap:1px; padding-inline:4px; }
  .nav a { min-width:0; width:clamp(54px,17vw,76px); padding-inline:1px; }
  #timeline { padding-left:14px; }
  #timeline details::before { left:-21px; }
}

/* Leave room for the phone's camera cutout, home indicator and on-screen keyboard. */
.top { padding-top:env(safe-area-inset-top, 0px); }
@media (max-width:960px), (pointer:coarse) {
  html { scroll-padding-bottom:calc(84px + env(safe-area-inset-bottom, 0px)); }
  .top .wrap, main.wrap {
    --gutter:max(18px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
    width:calc(100% - var(--gutter) - var(--gutter)); max-width:1000px;
  }
  #entry { padding-inline:max(16px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px)); }
  #material-form label { min-width:0; }
  #material-form :is(input, select, textarea), #material-move select { font-size:1rem; min-height:44px; }
  #material-detail {
    width:min(560px, calc(100% - 24px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
    max-height:calc(100vh - 24px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    max-height:calc(100dvh - 24px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    padding:14px; overscroll-behavior:contain;
  }
  #material-detail form { position:sticky; top:0; z-index:1; width:max-content; margin-left:auto; }
  .material-row { gap:4px; padding-inline:0; }
  .material-row input {
    -webkit-appearance:none; appearance:none; display:grid; place-items:center;
    width:44px; height:44px; margin:0; color:var(--pink); background:transparent;
  }
  .material-row input::before {
    content:''; display:grid; place-items:center; width:22px; height:22px;
    border:2px solid currentColor; border-radius:5px; line-height:1;
  }
  .material-row input:checked::before { content:'✓'; font-weight:700; color:white; border-color:var(--pink); background:var(--pink); }
  .material-row input:disabled { opacity:.65; }
  body:has(#material-form :is(input:not([type=file]), textarea):focus, #view-code:focus) .nav { visibility:hidden; }
}
@media (orientation:landscape) and (max-height:500px) {
  #entry { padding-top:max(12px, env(safe-area-inset-top, 0px)); }
  #entry-title { font-size:clamp(2.8rem, 10vh, 4rem); }
  #entry-form { margin-top:12px; }
}
