@property --sky-top {
  syntax: "<color>";
  inherits: true;
  initial-value: #101d33;
}

@property --sky-bottom {
  syntax: "<color>";
  inherits: true;
  initial-value: #243b58;
}

@property --hill-back {
  syntax: "<color>";
  inherits: true;
  initial-value: #1a2e51;
}

@property --hill-front {
  syntax: "<color>";
  inherits: true;
  initial-value: #101e37;
}

:root {
  --sky-top: #101d33;
  --sky-bottom: #243b58;
  --hill-back: #1a2e51;
  --hill-front: #101e37;
  --scene-text: #eef2ff;
  --scene-muted: #cad6ea;
  --sun-progress: 0.5;
  --sun-altitude: 1;
  --sun-opacity: 0;
  --night-opacity: 1;
  transition:
    --sky-top 1.5s ease,
    --sky-bottom 1.5s ease,
    --hill-back 1.5s ease,
    --hill-front 1.5s ease;
}

body {
  min-height: 100dvh;
  isolation: isolate;
}

/* A quiet, fixed backdrop shows through the workspace's glass surfaces. */
.ambient-background {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    var(--sky-top) 0,
    var(--sky-top) 320px,
    var(--sky-bottom) 100%
  );
}

.ambient-clouds {
  position: absolute;
  inset: 0;
  opacity: 0.5;
  background:
    radial-gradient(ellipse 29% 4% at 82% 350px, #ffffff35, transparent 100%),
    radial-gradient(ellipse 19% 2% at 72% 380px, #ffffff20, transparent 100%),
    radial-gradient(ellipse 38% 5% at 19% 500px, #ffffff18, transparent 100%);
}

:root[data-theme="dark"] .ambient-clouds {
  opacity: 0.12;
}

.ambient-landscape {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: clamp(220px, 34vh, 420px);
}

.ambient-hill-far {
  fill: var(--hill-back);
  opacity: 0.38;
}

.ambient-hill-back {
  fill: var(--hill-back);
  opacity: 0.58;
}

.ambient-hill-front {
  fill: var(--hill-front);
  opacity: 0.72;
}

.ambient-trees {
  fill: var(--hill-front);
  opacity: 0.85;
}

.app-root {
  grid-template-columns: 228px minmax(0, 1fr);
}

.dock {
  top: 12px;
  height: calc(100dvh - 24px);
  margin: 12px 0 12px 12px;
  padding: 26px 16px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 10px 30px #14243d0d;
}

.app-header {
  height: 72px;
  padding: 0 32px;
  border-bottom: 0;
  background: transparent;
}

.breadcrumb {
  gap: 12px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.header-actions #header-date {
  padding: 5px 9px;
  border-radius: 8px;
  background: var(--surface);
}

.app-content {
  max-width: 1500px;
  padding: 8px 32px 20px;
}

.theme-picker {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.theme-picker button {
  min-height: 33px;
  padding: 5px 13px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  border-radius: 8px;
}

.theme-picker button:hover {
  background: var(--raised);
  color: var(--text);
}

.theme-picker button[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: 0 2px 8px #0000000a;
}

.theme-picker .icon {
  width: 17px;
  height: 17px;
}

.time-scene {
  isolation: isolate;
  position: relative;
  height: 160px;
  margin-bottom: 24px;
  color: var(--scene-text);
}

.scene-celestial {
  position: absolute;
  z-index: 0;
  top: 0;
  right: 0;
  width: min(60%, 650px);
  height: 100%;
  pointer-events: none;
}

.scene-sun {
  position: absolute;
  left: calc(12% + var(--sun-progress) * 76%);
  top: calc(76% - var(--sun-altitude) * 52%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff5c7;
  box-shadow:
    0 0 26px 7px #fff2be70,
    0 0 60px 16px #ffdd8d24;
  opacity: var(--sun-opacity);
  transform: translate(-50%, -50%);
  transition:
    left 1.5s ease,
    top 1.5s ease,
    opacity 1.5s ease;
}

.scene-moon {
  position: absolute;
  top: 28px;
  right: 12%;
  width: 37px;
  height: 37px;
  fill: #e4ecff;
  filter: drop-shadow(0 0 12px #c1d6ff40);
  opacity: var(--night-opacity);
}

:root[data-theme="light"] .scene-moon {
  fill: #64789c;
  filter: none;
}

.scene-stars {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: #e9f1ff;
  opacity: var(--night-opacity);
}

:root[data-theme="light"] .scene-stars {
  fill: #697c9b;
}

.scene-moon,
.scene-stars {
  transition: opacity 1.5s ease;
}

.scene-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  height: 100%;
  width: fit-content;
  max-width: 65%;
  padding: 0 4px;
}

.scene-greeting {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.scene-clock {
  display: block;
  font-size: 64px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -2px;
  line-height: 1.13;
}

.scene-date {
  margin-top: 5px;
  font-size: 13px;
  font-weight: 550;
  letter-spacing: 0.4px;
}

.scene-caption {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 9px;
  color: var(--scene-muted);
  font-size: 11px;
}

.scene-status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.scene-period {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.scene-period::before {
  content: "·";
}

.panel,
.search-form {
  border-radius: 15px;
  background: var(--surface);
  box-shadow: 0 5px 20px #14243d08;
}

/* Only the surface is translucent; text, icons and focus rings stay opaque. */
.dock,
.breadcrumb,
.header-actions #header-date,
.theme-picker,
#home-screen .panel,
#home-screen .search-form,
.home-introduction,
.site-footer {
  border-color: var(--glass-border, var(--line));
  background: var(--glass-surface, var(--surface));
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow:
    inset 0 1px 0 #ffffff0a,
    0 8px 28px #14243d08;
}

#home-screen .search-form:focus-within,
#home-calendar:hover,
#home-calendar:focus-within {
  border-color: var(--accent);
}

/* Inner controls share the card's backdrop instead of stacking opaque tiles. */
#home-screen .shortcut-item,
#home-screen .category-pill,
#home-todos .todo-date-nav input,
#home-todos .todo-filters button,
#home-todos #todo-login {
  border-color: var(--glass-border, var(--line));
  background: transparent;
}

#home-screen .shortcut-item:hover,
#home-screen .quick-link:hover,
#home-screen .recent-row:hover,
#home-screen .category-pill:hover,
#home-screen .category-pill[aria-pressed="true"],
#home-todos .todo-filters button:hover,
#home-todos .todo-filters button[aria-pressed="true"],
#home-todos #todo-login:hover,
.dock .dock-button:hover,
.dock .dock-button.is-active,
.theme-picker button:hover,
.theme-picker button[aria-pressed="true"] {
  background: var(--glass-raised, var(--raised));
}

#home-screen .category-pill[aria-pressed="true"],
#home-todos .todo-filters button[aria-pressed="true"] {
  border-color: var(--accent);
}

.dock .dock-button.is-active {
  box-shadow: inset 3px 0 0 var(--accent);
}

#home-screen .quick-icon,
.dock .avatar {
  background: var(--glass-raised, var(--accent-soft));
}

#home-calendar .today-footer,
#home-todos .todo-row,
#home-todos .todo-quick,
.dock .dock-user {
  border-color: var(--glass-border, var(--line));
}

#home-todos #todo-progress {
  background: var(--glass-raised, var(--raised));
}

#home-todos #todo-progress::-webkit-progress-bar {
  background: var(--glass-raised, var(--raised));
}

/* Editing and account screens remain uninterrupted reading surfaces. */
#notes-app,
#resume-section,
#admin-screen {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

.home-introduction {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  margin-top: 22px;
  padding: 16px 20px;
  border: 1px solid var(--glass-border, var(--line));
  border-radius: 14px;
  background: var(--glass-surface, var(--surface));
}

.home-introduction h1 {
  flex-shrink: 0;
  font-size: 15px;
  line-height: 1.8;
  letter-spacing: 0;
  font-weight: 600;
}

.home-introduction #site-introduction {
  max-width: 880px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.8;
}

.site-footer {
  margin: 0 32px 16px;
  padding: 16px 20px;
  border: 1px solid var(--glass-border, var(--line));
  border-radius: 14px;
  background: var(--glass-surface, var(--surface));
}

.account-menu {
  width: min(290px, calc(100vw - 16px));
  max-height: calc(100dvh - 16px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.account-menu-settings {
  margin: 8px 6px;
  padding: 14px 6px 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.transparency-setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  font-weight: 550;
}

#transparency-value {
  min-width: 38px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

#interface-transparency {
  display: block;
  width: 100%;
  height: 36px;
  margin: 4px 0 0;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  accent-color: var(--accent);
  cursor: pointer;
  touch-action: pan-y;
}

.transparency-scale {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10px;
}

#transparency-hint,
#transparency-status {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.account-menu #transparency-reset {
  display: inline-flex;
  width: auto;
  min-height: 32px;
  margin-top: 5px;
  padding: 5px 0;
  color: var(--accent);
  font-size: 11px;
}

.account-menu #transparency-reset:hover {
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 3px;
}

:root
  :is(
    .primary-button,
    .search-submit,
    .brand-mark,
    .skip-link,
    .calendar-tabs button[aria-pressed="true"],
    .calendar-years button[aria-pressed="true"],
    .calendar-day[aria-pressed="true"]
  ) {
  background: #2866df;
  border-color: #2866df;
  color: #fff;
}

:root
  :is(
    .primary-button,
    .search-submit,
    .calendar-tabs button[aria-pressed="true"],
    .calendar-years button[aria-pressed="true"],
    .calendar-day[aria-pressed="true"]
  ):hover {
  background: #245bc7;
  border-color: #245bc7;
}

body,
.dock,
.panel,
.search-form,
.theme-picker,
.breadcrumb,
.header-actions #header-date,
.home-introduction,
.site-footer,
#notes-app,
#resume-section,
#admin-screen {
  transition:
    background-color 1s ease,
    border-color 1s ease,
    color 1s ease;
}

@media (max-width: 1200px) {
  .app-root {
    grid-template-columns: 208px minmax(0, 1fr);
  }

  .dock {
    padding-right: 12px;
    padding-left: 12px;
  }

  .app-header {
    padding: 0 24px;
  }

  .app-content {
    padding: 8px 24px 20px;
  }

  .site-footer {
    margin-right: 24px;
    margin-left: 24px;
  }
}

@media (max-width: 980px) {
  .app-root {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .dock {
    padding: 24px 9px;
    border-radius: 15px;
  }

  #notes-app,
  #resume-section,
  #admin-screen {
    padding: 18px;
  }
}

@media (max-width: 700px) {
  .header-actions #header-date {
    display: none;
  }

  .home-introduction {
    display: block;
  }

  .home-introduction #site-introduction {
    margin-top: 5px;
  }

  .scene-celestial {
    width: 45%;
  }
}

@media (max-width: 540px) {
  .dock {
    top: auto;
    height: 70px;
    margin: 0;
    padding: 8px 14px;
    border: 0;
    border-top: 1px solid var(--glass-border, var(--line));
    border-radius: 0;
    box-shadow: 0 -4px 20px #14243d0a;
  }

  .app-header {
    min-height: 62px;
    height: auto;
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .breadcrumb {
    padding: 5px 8px;
    gap: 7px;
    font-size: 10px;
  }

  .app-content {
    padding: 4px 16px 16px;
  }

  .theme-picker {
    padding: 2px;
    gap: 1px;
    border-radius: 10px;
  }

  .theme-picker button {
    min-height: 33px;
    padding: 5px 8px;
    gap: 5px;
    font-size: 11px;
  }

  .theme-picker .icon {
    width: 15px;
    height: 15px;
  }

  .time-scene {
    height: 146px;
    margin-bottom: 18px;
  }

  .scene-copy {
    padding: 0 2px;
  }

  .scene-celestial {
    width: 36%;
  }

  .scene-greeting {
    font-size: 16px;
  }

  .scene-clock {
    font-size: 54px;
    letter-spacing: -1.5px;
  }

  .scene-date {
    font-size: 12px;
    letter-spacing: 0;
  }

  .scene-caption {
    font-size: 10px;
    margin-top: 8px;
    gap: 5px;
  }

  .scene-sun {
    width: 34px;
    height: 34px;
  }

  .scene-moon {
    top: 33px;
    width: 31px;
    height: 31px;
  }

  .ambient-landscape {
    width: 180%;
    left: -40%;
    height: 230px;
  }

  #notes-app,
  #resume-section,
  #admin-screen {
    padding: 14px;
    border-radius: 14px;
  }

  .home-introduction {
    margin-top: 18px;
    padding: 14px 16px;
  }

  .site-footer {
    margin: 0 16px 14px;
    padding: 14px;
  }
}

/* Avoid a frame of light text on the old light background (or vice versa). */
:root[data-theme-transition="instant"],
:root[data-theme-transition="instant"] *,
:root[data-theme-transition="instant"] *::before,
:root[data-theme-transition="instant"] *::after {
  transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
  :root,
  .scene-sun,
  .scene-moon,
  .scene-stars,
  body,
  .dock,
  .panel,
  .search-form,
  .theme-picker,
  .breadcrumb,
  .header-actions #header-date,
  .home-introduction,
  .site-footer,
  #notes-app,
  #resume-section,
  #admin-screen {
    transition: none;
  }
}
