@font-face {
  font-family: Caveat;
  src: url('/media/fonts/caveat-600.woff2') format('woff2');
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

:root {
  color-scheme: dark;
  font-family: "Avenir Next", Avenir, "Trebuchet MS", sans-serif;
  color: #c9c7b8;
  background: #111511;
  --accent: #bdcba1;
  --highlight-bg: #bdcba11a;
  --muted: #959b8c;
  --line: #c3c8b126;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
h1, h2, p, figure { margin: 0; }
h1, h2, .countdowns strong { font-family: Georgia, serif; font-weight: 400; }
a { color: var(--accent); }
.tv {
  --tv-background: #121711;
  background: var(--tv-background);
  --dashboard-fade: 450ms;
  --gallery-slide: 550ms;
}
.tv[data-theme="ink"] { --tv-background: #12161b; }
.tv[data-theme="ember"] { --tv-background: #201813; }
.tv[data-theme="black"] { --tv-background: #080909; }
.preview-tools { position: fixed; z-index: 20; right: 1rem; bottom: .75rem; display: flex; align-items: center; gap: 1rem; padding: .45rem .7rem; border: 1px solid var(--line); border-radius: 6px; background: #161b16; font-size: .875rem; }
.preview-tools button { padding: .42em .65em; color: var(--accent); font: inherit; background: #2b3327; border: 1px solid #8a9b6770; border-radius: 4px; cursor: pointer; }
.preview-tools :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.scene {
  width: min(100%, 2000px);
  min-height: 100vh;
  margin-inline: auto;
  overflow: clip;
  padding: 5vh 4vw;
  display: grid;
  align-items: stretch;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.33fr);
  gap: 4vw;
  transition: opacity 2s ease;
}
.dashboard {
  --section-gap: clamp(24px, 3.7vh, 44px);
  width: 100%;
  margin-block: auto;
  min-width: 0;
  z-index: 1;
  transform: translate(var(--shift-x, 0px), var(--shift-y, 0px));
  transition: transform 3s ease;
}
.dashboard-details {
  display: grid;
  gap: var(--section-gap);
  transition: opacity var(--dashboard-fade) ease var(--gallery-slide),
    visibility 0s var(--gallery-slide);
}
.today {
  display: grid;
  gap: var(--section-gap);
  margin-block-end: var(--section-gap);
  transform-origin: top left;
  transition: transform var(--gallery-slide) ease-in-out;
}
.clock-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .75rem;
}
.today-date, .weather-city { color: var(--accent); font-size: clamp(13px, 1.2vw, 25px); }
.today-date { text-align: end; line-height: 1.17; }
.clock {
  display: flex;
  align-items: baseline;
  gap: .14em;
  white-space: nowrap;
  font-size: clamp(40px, 5.55vw, 111px);
  line-height: .94;
  letter-spacing: -.063em;
  font-variant-numeric: lining-nums tabular-nums;
}
#period { font: 500 .23em/1 "Avenir Next", Avenir, "Trebuchet MS", sans-serif; letter-spacing: .025em; color: var(--muted); }
.weather-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: .4em; }
.weather-slots {
  display: flex;
  gap: clamp(2px, .24vw, 5px);
}
.weather-slot {
  --weather-padding-start: .55em;
  --condition-offset: 2px;
  flex: 1;
  padding: var(--weather-padding-start) clamp(6px, .65vw, 12px) .16em;
  min-width: 0;
  text-align: start;
}
.weather-slot:first-child {
  align-self: flex-start;
  padding-block-end: calc(var(--weather-padding-start) + var(--condition-offset));
  border-inline-start: 2px solid var(--accent);
  background: var(--highlight-bg);
}
.weather-slot:first-child:has(~ .weather-slot:not([hidden])) {
  margin-inline-end: clamp(12px, 1.55vw, 30px);
}
.weather-slot:first-child .temperature { color: var(--accent); }
.weather-slot:not(:first-child) { padding-inline: clamp(4px, .52vw, 10px); }
.weather-label { color: var(--muted); font-size: clamp(11px, .91vw, 19px); line-height: 1; }
.weather-slot:not(:first-child) .weather-label { position: relative; inset-block-start: 1px; }
.temperature {
  font: 400 clamp(19px, 2.3vw, 44px)/1.05 Georgia, serif;
  font-variant-numeric: lining-nums tabular-nums;
  margin-block: -.04em .04em;
  white-space: nowrap;
}
.temperature span { font-size: .68em; }
.weather-condition { position: relative; inset-block-start: var(--condition-offset); color: #b8bcab; font-size: clamp(12px, 1.02vw, 21px); line-height: 1.1; overflow-wrap: anywhere; }
.weather-credit { color: var(--muted); font-size: clamp(9px, .76vw, 15px); }
.countdowns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(14px, 1.7vh, 22px) 12px;
}
.countdowns article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}
.countdown-number {
  display: grid;
  place-content: center;
  gap: .15rem;
  min-inline-size: clamp(42px, 4vw, 80px);
  padding: clamp(7px, .65vw, 13px) .3rem;
  background: var(--highlight-bg);
  color: var(--accent);
  text-align: center;
}
.countdown-number strong {
  font-size: clamp(23px, 2.45vw, 49px);
  line-height: .95;
  font-variant-numeric: lining-nums tabular-nums;
}
.countdown-unit {
  font-size: clamp(11px, .87vw, 17px);
  line-height: 1.1;
}
.countdown-status strong { font-size: clamp(12px, 1.05vw, 21px); }
.countdown-details {
  display: grid;
  align-content: center;
  gap: .2rem;
  padding: clamp(7px, .75vw, 15px);
}
.countdowns p { overflow-wrap: anywhere; font-size: clamp(13px, 1.3vw, 26px); line-height: 1.2; }
.countdowns time { color: var(--muted); font-size: clamp(11px, .9vw, 18px); line-height: 1.15; }
.countdowns[data-count="1"] { grid-template-columns: minmax(0, 1fr); }
.countdowns:is([data-count="3"], [data-count="4"]) { column-gap: 8px; }
.countdowns:is([data-count="3"], [data-count="4"]) .countdown-number:not(.countdown-status) strong {
  font-size: clamp(22px, 2.2vw, 44px);
}
.agenda h2 { font-size: clamp(17px, 1.55vw, 32px); margin-bottom: .65vh; }
.events {
  --event-date-width: 3.85em;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: clamp(13px, 1.25vw, 25px);
}
.events li { display: grid; grid-template-columns: var(--event-date-width) minmax(0, 1fr) auto; align-items: baseline; column-gap: .55em; padding-block: .48em; }
.events li:has(.event-people):has(.event-start) { grid-template-columns: var(--event-date-width) minmax(0, 1fr) auto auto; }
.events li + li { border-top: 1px solid var(--line); }
.events time { color: var(--accent); font-variant-numeric: tabular-nums; }
.events .event-start {
  inline-size: 4.25em;
  color: var(--muted);
  text-align: end;
  white-space: nowrap;
}
.events .event-start small { font-size: .72em; }
.events .event-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.event-people {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  row-gap: .18em;
  padding-block: .1em;
  align-self: center;
  max-inline-size: min(6.5em, 30vw);
  isolation: isolate;
}
.event-people:has(+ .event-start) { margin-inline-end: -.46em; }
.event-person + .event-person { margin-inline-start: -4px; }
.event-person {
  position: relative;
  display: grid;
  place-items: center;
  width: 1.95em;
  height: 1.95em;
  border: 1px solid var(--line);
  border-radius: 50%;
  overflow: hidden;
  color: var(--accent);
  background: linear-gradient(var(--highlight-bg), var(--highlight-bg)), var(--tv-background, var(--studio-panel, #121711));
  font: 600 .72em/1 sans-serif;
}
.event-person img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
#events-empty { color: var(--muted); font-size: clamp(13px, 1.15vw, 22px); padding-block: .35em; }
.gallery-slot {
  position: relative;
  min-height: 240px;
  --photo-width: min(70vw, 90vh);
  --photo-height: 90vh;
}
.gallery {
  position: relative;
  margin: 0;
  min-height: 240px;
  isolation: isolate;
  background: radial-gradient(ellipse at 50% 53%, #8384711c, transparent 68%);
}
.gallery-slot > .gallery {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  transition: left var(--gallery-slide) ease-in-out,
    top var(--gallery-slide) ease-in-out,
    width var(--gallery-slide) ease-in-out,
    height var(--gallery-slide) ease-in-out,
    filter var(--gallery-slide) ease-in-out;
}
.gallery[data-photo-mode="grid"] {
  container-type: size;
  display: grid;
  place-items: center;
}
.print-grid {
  width: min(92%, 79cqh);
  aspect-ratio: .89;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 3%;
}
.print-cell { position: relative; }
.polaroid {
  position: absolute;
  top: var(--y);
  left: var(--x);
  width: var(--width);
  aspect-ratio: .89;
  display: grid;
  align-items: start;
  padding: 2% 2% 5%;
  border-radius: 2px;
  background: #837e6f;
  box-shadow: 0 10px 27px #03050394, 0 1px 3px #030503a0;
  transform: translate(-50%, -50%) rotate(var(--angle));
  transition: background 1100ms ease var(--promotion-delay, 0ms);
}
.polaroid[data-featured="true"] { background: #b5ac94; }
.polaroid[data-layer="back"] { background: #716d61; }
.polaroid.departing { transition: none; }
.polaroid img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: #232724;
  filter: brightness(.68) saturate(.85);
  transition: filter 800ms ease var(--promotion-delay, 0ms);
}
.polaroid[data-featured="true"] img { filter: brightness(.82) saturate(.91); }
.polaroid time {
  position: absolute;
  inset-inline: 8%;
  bottom: 4.5%;
  overflow: hidden;
  color: #302c23;
  font: 600 clamp(13px, 1.55vw, 30px)/1.1 Caveat, cursive;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  transform: rotate(-2deg);
}
.print-cell .polaroid {
  inset: 0;
  width: 100%;
  padding: 5% 5% 11%;
  transform: none;
  overflow: hidden;
  background: #b5ac94;
}
.print-cell .polaroid img { filter: brightness(.82) saturate(.91); }
.print-cell .polaroid time {
  bottom: 3%;
  font-size: clamp(9px, 2.1cqh, 23px);
  transform: none;
}
.tv[data-photo-layout] .dashboard-details {
  visibility: hidden;
  opacity: 0;
  transition: opacity var(--dashboard-fade) ease, visibility 0s var(--dashboard-fade);
}
.tv[data-photo-layout] .today {
  transform: translateY(calc(4vh - var(--dashboard-top, 0px))) scale(.65);
  transition-delay: var(--dashboard-fade);
}
.tv[data-photo-layout] .gallery-slot > .gallery {
  left: calc((100vw - var(--photo-width)) / 2 - var(--gallery-left, 0px));
  top: calc((100vh - var(--photo-height)) / 2 - var(--gallery-top, 0px));
  width: var(--photo-width);
  height: var(--photo-height);
  filter: brightness(.60) saturate(.9);
  transition-delay: var(--dashboard-fade);
}
.tv[data-scene="black"] .scene { visibility: hidden; opacity: 0; transition: opacity 2s ease, visibility 0s 2s; }
.tv[data-scene="black"] { background: #000; }
@media (orientation: landscape) {
  .scene:has(.events > li:nth-child(7)) { padding-block: 4vh; }
  .scene .events:has(> li:nth-child(7)) { font-size: clamp(13px, min(1.25vw, 2.35vh), 25px); }
  .scene .events:has(> li:nth-child(7)) li { padding-block: .26em; }
}
@media (max-width: 730px) and (orientation: portrait) {
  .scene { grid-template-columns: minmax(0, 1fr); padding: 4vh 5vw; gap: 18px; }
  .gallery-slot { order: -1; width: 100%; aspect-ratio: 1.03; --photo-width: min(92vw, 96vh); --photo-height: 65vh; }
  .tv:has(.preview-tools) .scene { padding-bottom: 4.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  .scene, .dashboard, .today, .dashboard-details, .gallery-slot > .gallery, .polaroid, .polaroid img { transition: none !important; }
}

.control { display: flow-root; min-height: 100vh; background: #171b17; color: #e5e5d8; font-size: 1rem; }
.shell { width: min(760px, calc(100% - 32px)); margin: 38px auto 64px; }
.control header { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: baseline; gap: 16px; border-bottom: 1px solid var(--line); padding-bottom: 22px; margin-bottom: 24px; }
.control h1 { font-size: clamp(2rem, 6vw, 3.5rem); letter-spacing: -.04em; }
.control h2 { font-size: 1.65rem; margin-bottom: .7em; }
.control fieldset, .account { border: 1px solid var(--line); border-radius: 6px; padding: 16px 20px 20px; margin: 0 0 20px; min-width: 0; }
.control legend { padding: 0 .5em; color: var(--accent); }
.control label { display: grid; gap: 6px; min-width: 0; }
.control input, .control button, .control select { font: inherit; }
.control input, .control select { min-width: 0; width: 100%; min-height: 42px; padding: 7px 9px; border-radius: 4px; background: #131713; color: inherit; border: 1px solid #a3ad877a; }
.control button { min-height: 42px; padding: 7px 16px; border: 1px solid #b9c69b; border-radius: 4px; background: #bdcba1; color: #202717; cursor: pointer; }
.control button.secondary { background: transparent; color: #dae0c9; }
.control button:disabled { opacity: .55; cursor: default; }
.control :focus-visible { outline: 2px solid #d7e4ac; outline-offset: 3px; }
.edit-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(140px, .55fr); gap: 14px; margin-bottom: 14px; }
.edit-row:last-child { margin-bottom: 0; }
.widget-row { grid-template-columns: minmax(0, 1fr) minmax(126px, .55fr) auto; align-items: end; margin-bottom: 14px; }
.widget-row:last-child { margin-bottom: 14px; }
.photo-fields, .account form { display: grid; gap: 13px; }
.location-search { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; margin-bottom: 12px; }
.location-results { margin-bottom: 12px; }
.control nav, .actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.control .hint, #status { color: #bcc3af; line-height: 1.4; }
.control .hint { margin: 0 0 12px; }
#status { margin: 12px 0; min-height: 1.4em; }
@media (max-width: 420px) {
  .edit-row { grid-template-columns: 1fr; }
  .widget-row button { justify-self: start; }
}

.photo-link { margin-top: 12px; }
.photo-list { display: grid; gap: 8px; padding: 0; margin: 0 0 12px; list-style: none; }
.photo-list li {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
}
.photo-list img { width: 56px; height: 48px; object-fit: cover; background: #272d27; border-radius: 2px; }
.photo-list span { overflow-wrap: anywhere; }
.photo-import { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.photo-import small { color: var(--muted); }
#choose-calendar { margin-top: 12px; }
#calendar-config { color: var(--muted); }
#calendar-status { margin-top: 10px; }

#profiles > form { margin-top: 14px; }
#profiles form.edit-row { display: flex; flex-wrap: wrap; align-items: end; margin-block: 12px; }
#profiles form.edit-row label { flex: 1 1 160px; }
#profiles details { border-top: 1px solid var(--line); padding-block: 12px; }
#profiles summary { cursor: pointer; color: var(--accent); }
.management-list { list-style: none; padding: 0; margin: 10px 0 0; }
.management-list li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.management-list li + li { margin-top: 8px; }
.management-list li span { flex: 1 1 150px; overflow-wrap: anywhere; }
.management-list select { width: auto; max-width: 100%; }

.pairing-setup { max-width: 72rem; }
.pairing-setup .account { margin-block-start: clamp(2rem, 8vh, 8rem); text-align: center; font-size: clamp(1rem, 2.3vw, 2rem); }
.pairing-setup .pairing-code { font: 600 clamp(2.8rem, 8vw, 8rem)/1.1 monospace; letter-spacing: .08em; margin-block: .35em; color: var(--accent); }
.pairing-setup #status { margin-block: 1em; }
.pairing-setup button:focus-visible { outline: 3px solid currentColor; outline-offset: 5px; }

.studio-footer { margin-top: 1.5rem; font-size: .9em; }
.control dialog { width: min(34rem, calc(100% - 2rem)); padding: 1.4rem; border: 1px solid var(--line); border-radius: 8px; background: #1b211a; color: inherit; }
.control dialog::backdrop { background: #080a08bb; }
.control dialog p { margin-block: .8rem 1.3rem; line-height: 1.5; }
.dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .65rem; }
.privacy h2 { margin-top: 1.5rem; }
.privacy p { margin-block: .5rem .9rem; line-height: 1.55; }
