/* One desk and one notebook: the clock changes illumination, not materials. */
html[data-life-tod] {
  --nb-casing-bg: #e4ddcd;
  --nb-casing-border: rgba(106, 92, 70, .19);
  --nb-page-bg: #fbf9f2;
  --nb-page-gradient: linear-gradient(144deg, rgba(255,255,255,.32), transparent 48%), linear-gradient(#fbf9f2, #f8f5ed);
  --nb-page-border: rgba(171, 155, 132, .26);
  --nb-spine-line: rgba(126, 117, 99, .26);
  --nb-stack-shadow: 2px 0 #f5f0e5, 4px 0 #e8dfcf, 6px 0 rgba(139, 125, 103, .2);
  --nb-ink: #28332f;
  --nb-ink-pen: #323c37;
  --nb-ink-secondary: #68736b;
  --nb-ink-faint: #8b978c;
  --nb-line: rgba(70, 84, 73, .13);
  --nb-line-subtle: rgba(70, 84, 73, .08);
  --nb-polaroid-bg: #fdfbf6;
  --nb-polaroid-border: rgba(255,255,255,.9);
  --nb-polaroid-shadow: 0 5px 16px rgba(55,49,37,.09);
  --nb-polaroid-hover-shadow: 0 11px 25px rgba(55,49,37,.17);
  --nb-vellum-bg: rgba(255,255,255,.42);
  --nb-vellum-border: rgba(255,255,255,.64);
  --nb-vellum-shadow: 0 4px 12px rgba(55,49,37,.04);
  --nb-tape: rgba(222,210,186,.45);
}

html[data-life-tod] body,
html[data-life-tod] .confirmed-site,
html[data-life-tod] .v3-life-current-main {
  background: transparent;
}
html[data-life-tod] .v3-life-current-main {
  width: 100%;
  max-width: none;
}

html[data-life-tod] .life-scene-ambient {
  background: #ddd2c0;
}

html[data-life-tod] .life-desk-surface {
  background: #dfd3c1 url('./pale-oak.webp') center center / cover no-repeat;
}

html[data-life-tod] .life-desk-surface::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(222,211,191,.27);
  transition: background 2.4s ease;
  pointer-events: none;
}

html[data-life-tod] .life-desk-wood-grain { display: none; }

.life-window-shadow {
  position: absolute;
  inset: -8% -12%;
  background: url('./window-shadow.svg') center top / 100% 100% no-repeat;
  opacity: var(--life-shadow-opacity, .72);
  transform: translate(var(--life-shadow-x, 0px), var(--life-shadow-y, 0px)) rotate(var(--life-shadow-angle, -8deg));
  transform-origin: 24% 12%;
  /* The blurred, viewport-sized SVG must not animate its position on the GPU. */
  transition: opacity 2.4s ease;
  pointer-events: none;
  z-index: 2;
}

html[data-life-tod] .life-desk-sunlight {
  inset: 0;
  width: auto;
  height: auto;
  opacity: var(--life-daylight-opacity, 1);
  filter: none;
  background:
    radial-gradient(ellipse 85% 90% at 12% 4%, rgba(255,251,229,.48), transparent 76%),
    linear-gradient(133deg, rgba(255,255,246,.23), rgba(255,251,229,.08) 54%, transparent 83%);
  transition: opacity 2.4s ease, background 2.4s ease;
  z-index: 1;
}

html[data-life-tod] .life-desk-lamp-pool,
html[data-life-tod] .life-desk-vignette { opacity: 0; }

html[data-life-tod='afternoon'] .life-desk-surface::before {
  background: rgba(215,174,126,.27);
}
html[data-life-tod='afternoon'] .life-desk-sunlight {
  background:
    radial-gradient(ellipse 85% 80% at 8% 4%, rgba(255,230,175,.54), transparent 75%),
    linear-gradient(130deg, rgba(255,223,161,.31), rgba(255,241,213,.07) 62%, transparent 85%);
}

html[data-life-tod='night'] .life-desk-surface::before {
  background: rgba(18,25,29,.76);
}
html[data-life-tod='night'] .life-window-shadow,
html[data-life-tod='night'] .life-desk-sunlight { opacity: 0; }
html[data-life-tod='night'] .life-desk-lamp-pool {
  opacity: 1;
  filter: none;
  background: radial-gradient(ellipse 64% 86% at 56% 35%, rgba(255,219,157,.38), rgba(233,170,97,.15) 48%, transparent 86%);
  transition: opacity 2.4s ease;
}
html[data-life-tod='night'] .life-desk-vignette {
  opacity: 1;
  background: radial-gradient(ellipse 87% 93% at 52% 34%, transparent 38%, rgba(4,12,19,.39) 100%);
  transition: opacity 2.4s ease;
}

html[data-life-tod] .life-notebook-container {
  max-width: 1000px;
  padding-top: 2.4rem;
}

/* Life follows the local clock, so shared manual theme controls stay off this page. */
html[data-life-tod] .confirmed-theme-control,
html[data-life-tod] .confirmed-footer-theme {
  display: none;
}

html[data-life-tod] .life-notebook-casing {
  background-color: var(--nb-casing-bg);
  background-image:
    repeating-linear-gradient(0deg, rgba(255,255,255,.09) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(108,96,77,.035) 0 1px, transparent 1px 4px);
  border: 1px solid var(--nb-casing-border);
  border-radius: 7px;
  padding: 10px 12px 13px 10px;
  box-shadow:
    var(--life-contact-x, 3px) var(--life-contact-y, 9px) 13px -7px rgba(56,43,27,.25),
    0 19px 34px -16px rgba(51,42,30,.2),
    0 28px 65px -28px rgba(55,44,29,.13);
  /* A long box-shadow tween repaints the whole notebook while scrolling. */
  transition: background-color .4s ease, border-color .4s ease;
}

html[data-life-tod='night'] .life-notebook-casing {
  box-shadow:
    6px 13px 17px -7px rgba(0,0,0,.55),
    0 26px 50px -16px rgba(0,0,0,.51),
    0 0 0 1px rgba(255,236,203,.04);
}

html[data-life-tod] .life-notebook-page {
  background-color: var(--nb-page-bg);
  background-image: var(--nb-page-gradient);
  border: 1px solid var(--nb-page-border);
  border-radius: 4px;
  box-shadow: inset 12px 0 15px -16px rgba(65,54,38,.14), 0 2px 8px rgba(58,51,40,.07);
  scroll-margin-top: 9rem;
}

html[data-life-tod] .life-notebook-page::after {
  background: linear-gradient(137deg, rgba(255,250,226,.19), transparent 41%);
  mix-blend-mode: normal;
}

html[data-life-tod='afternoon'] .life-notebook-page::after {
  background: linear-gradient(133deg, rgba(255,227,172,.2), transparent 43%);
}

html[data-life-tod='night'] .life-notebook-page {
  --nb-page-gradient: linear-gradient(145deg, #eee8d9, #e7dfd0);
}
html[data-life-tod='night'] .life-notebook-page::after {
  background: radial-gradient(ellipse 75% 78% at 54% 22%, rgba(255,231,181,.16), transparent 80%);
  mix-blend-mode: normal;
}

html[data-life-tod] .life-page-stack-edge {
  width: 5px;
  box-shadow: var(--nb-stack-shadow);
  opacity: .72;
}
html[data-life-tod] .life-notebook-ribbon { display: none; }

html[data-life-tod] .life-sticky-tab {
  color: #35443d;
  border: 1px solid rgba(74,90,72,.11);
  box-shadow: 1px 2px 5px rgba(46,51,39,.09);
  opacity: .92;
}
html[data-life-tod] .life-sticky-tab:nth-child(1) { background: #bdab87; }
html[data-life-tod] .life-sticky-tab:nth-child(2) { background: #a0b5aa; }
html[data-life-tod] .life-sticky-tab:nth-child(3) { background: #a3b49d; }
html[data-life-tod] .life-sticky-tab:nth-child(4) { background: #bda394; }
html[data-life-tod] .life-sticky-tab.is-active {
  box-shadow: 2px 4px 11px rgba(46,51,39,.16);
}
html[data-life-tod] .life-sticky-tab.is-active::after { background: #f8f5e9; box-shadow: none; }

@media (max-width: 768px) {
  html[data-life-tod] .life-notebook-container { padding-top: 1rem; }
  html[data-life-tod] [data-nav-variant] .confirmed-more-menu {
    left: auto;
    right: 0;
    transform: translateY(-6px);
  }
  html[data-life-tod] [data-nav-variant] .confirmed-more-menu.nav-open {
    transform: translateY(0);
  }
  html[data-life-tod] .life-notebook-casing {
    padding: 7px 7px 11px;
    border-radius: 5px;
  }
  html[data-life-tod] .life-window-shadow { opacity: .34; }
  html[data-life-tod='night'] .life-window-shadow { opacity: 0; }
  html[data-life-tod] .life-notebook-page { scroll-margin-top: 8.75rem; }
}

@media (prefers-reduced-motion: reduce) {
  .life-window-shadow,
  html[data-life-tod] .life-notebook-casing,
  html[data-life-tod] .life-desk-sunlight,
  html[data-life-tod] .life-desk-surface::before {
    transition-duration: 0s;
  }
  html[data-life-tod] .life-desk-lamp-pool,
  html[data-life-tod] .life-desk-vignette {
    transition-duration: 0s;
  }
}
