@font-face {
  font-family: "Suisse Intl";
  src: url("assets/fonts/SuisseIntl-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Suisse Intl";
  src: url("assets/fonts/SuisseIntl-Medium.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Iskra";
  src: url("assets/fonts/Iskra-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --background: #ff4600;
  --app-height: 100dvh;
  --marks: #000000;
  --mark-filter: invert(0);
  --text-rgb: 0 0 0;
  --layout-max: 1200px;
  --inner-gutter: clamp(24px, calc(24px + (100dvw - 393px) * 0.01528), 40px);
  --visual-gutter: max(var(--inner-gutter), env(safe-area-inset-left), env(safe-area-inset-right));
  --edge-gutter: max(var(--inner-gutter), calc((100dvw - var(--layout-max)) / 2 + var(--inner-gutter)));
  --footer-bottom: max(28px, env(safe-area-inset-bottom));
  --header-top: max(29px, env(safe-area-inset-top));
  --screen-transition-duration: 120ms;
  --screen-transition-ease: ease-out;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  min-height: 100%;
  margin: 0;
  background-color: var(--background);
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html {
  scroll-behavior: auto;
}

body {
  height: 100%;
  min-height: 100%;
  margin: 0;
  background-color: var(--background);
  overflow: hidden;
  color: rgb(var(--text-rgb) / 0.65);
  font-family: "Suisse Intl", Arial, sans-serif;
  font-size: 15px;
  font-style: normal;
  font-weight: 400;
  line-height: 24px;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: 0;
}

a {
  color: inherit;
}

.page {
  position: fixed;
  inset: 0;
  width: 100%;
  height: var(--app-height);
  overflow: hidden;
  touch-action: manipulation;
  background-color: var(--background);
}

.theme-stack {
  position: absolute;
  inset: 0;
  width: 100%;
  height: var(--app-height);
  overflow: hidden;
}

.theme-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: var(--app-height);
  min-height: var(--app-height);
  display: grid;
  place-items: center;
  background-color: var(--layer-background);
  color: rgb(var(--layer-text-rgb) / 0.65);
  overflow: hidden;
}

.clock-stage {
  position: relative;
  z-index: 1;
  width: min(610px, calc(100dvw - var(--edge-gutter) * 2));
  aspect-ratio: 1;
  transform: translateY(clamp(-18px, -2vh, -8px));
}

.clock {
  position: absolute;
  inset: 0;
  transform-origin: center;
  user-select: none;
}

.layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  filter: var(--layer-mark-filter);
  pointer-events: none;
  user-select: none;
}

.face {
  opacity: 0;
}

.numeral-slice {
  opacity: 1;
}

.hand {
  transform-origin: 50% 50%;
}

.header,
.footer {
  position: absolute;
  left: var(--visual-gutter);
  right: var(--visual-gutter);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: rgb(var(--layer-text-rgb) / 0.5);
}

.header {
  top: var(--header-top);
}

.footer {
  bottom: var(--footer-bottom);
}

.header a,
.studio-link {
  transition: color 120ms ease;
}

.header a:hover,
.header a:active,
.header a:focus-visible,
.studio-link:hover,
.studio-link:active,
.studio-link:focus-visible {
  color: rgb(var(--layer-text-rgb) / 1);
}

.header a,
.footer a {
  margin: 0;
  text-decoration: none;
}

.studio-link {
  white-space: nowrap;
}

.studio-link sup {
  font-size: 0.65em;
  line-height: 0;
  position: relative;
  top: -0.12em;
}

.site-title {
  margin: 0;
}

.download-link {
  white-space: nowrap;
}

.mobile-label {
  display: none;
}

.wallpaper {
  --face-size: min(calc((100vw - 160px) / 2), calc((var(--app-height) - 160px) * 0.8));
  --solo-size: min(calc(100vw - var(--visual-gutter) * 2), calc((var(--app-height) - 160px) * 0.791667));
  position: absolute;
  inset: 80px var(--visual-gutter);
}

.wallpaper .clock-stage {
  position: absolute;
  width: var(--face-size);
  left: 26.765%;
  top: 50%;
  transform: translate(-50%, -50%);
  transition-property: left, width, transform, top;
  transition-duration: var(--clock-duration, 1100ms);
  transition-timing-function: var(--motion-ease, cubic-bezier(0.16, 1, 0.3, 1));
}

.calendar {
  font-family: "Suisse Intl", Arial, sans-serif;
  position: absolute;
  left: 77.206%;
  top: 50%;
  width: calc(var(--face-size) * 0.78125);
  height: var(--calendar-height);
  color: var(--marks);
  transform: translate(-50%, -50%);
  transition: transform var(--clock-duration, 1100ms) var(--motion-ease, cubic-bezier(0.16, 1, 0.3, 1)), top var(--clock-duration, 1100ms) var(--motion-ease, cubic-bezier(0.16, 1, 0.3, 1)), visibility var(--clock-duration, 1100ms);
  letter-spacing: 0;
}

.calendar-content {
  width: 500px;
  transform: scale(var(--calendar-scale, 1));
  transform-origin: top left;
}

.calendar-month { font-size: 34px; line-height: 52px; font-weight: 400; margin: 0 0 19px; padding-left: 9px; color: rgb(var(--layer-text-rgb) / 0.75); overflow-wrap: anywhere; }
.calendar-weekdays, .calendar-dates { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); column-gap: 4px; text-align: center; }
.calendar-weekdays { color: rgb(var(--layer-text-rgb) / 0.25); font-size: 32px; line-height: 55px; margin-bottom: 12px; }
.calendar-dates { row-gap: 12px; }
.calendar-day { font-weight: 500; display: grid; place-items: center; width: 100%; height: 55px; font-size: 32px; line-height: 1; position: relative; isolation: isolate; color: rgb(var(--layer-text-rgb) / 0.75); }
.calendar-day[aria-current] { color: var(--background); }
.calendar-day[aria-current]::before { content: ''; position: absolute; width: 56px; height: 56px; left: 50%; top: 50%; border-radius: 20%; transform: translate(-50%, -50%); background: var(--marks); z-index: -1; }
.date-off .clock-stage { left: 50%; width: var(--solo-size); transform: translate(-50%, -50%); }
.date-off .calendar { visibility: hidden; transform: translate(calc(-50% + var(--calendar-travel)), -50%); }
.footer-switches { display: flex; }
.footer-switches button { border: 0; background: none; padding: 0; font: inherit; color: inherit; white-space: nowrap; transition: color 120ms ease; }
.footer-switches button:active { color: var(--marks); }
@media (hover: hover) and (pointer: fine) {
  .footer-switches button:hover { color: var(--marks); }
}
.footer-switches button:focus-visible { outline: 1px solid currentColor; outline-offset: 5px; }

.motion-panel { position: fixed; z-index: 10; top: max(16px, env(safe-area-inset-top)); right: 16px; width: min(260px, calc(100vw - 32px)); padding: 12px 16px; border-radius: 6px; background: var(--background); color: var(--marks); border: 1px solid currentColor; font-size: 13px; line-height: 20px; letter-spacing: 0; }
.motion-panel summary { user-select: none; }
.motion-controls { padding-top: 12px; display: grid; gap: 12px; }
.motion-controls label { display: grid; grid-template-columns: 1fr auto; gap: 4px; }
.motion-controls output { font-variant-numeric: tabular-nums; }
.motion-controls input { grid-column: 1 / -1; width: 100%; margin: 0; accent-color: var(--marks); }
.motion-actions { display: flex; justify-content: space-between; }
.motion-actions button { font: inherit; color: inherit; background: none; border: none; padding: 4px 0; }
.motion-actions button:hover { opacity: 0.6; }

@media (max-aspect-ratio: 4/5) {
  .wallpaper {
    --face-size: min(calc((100vw - var(--visual-gutter) * 2) * 0.724638), calc((var(--app-height) - 163px) / (1 + var(--calendar-relative-height, 0.812))));
    --solo-size: min(calc((100vw - var(--visual-gutter) * 2) * 0.927536), calc(var(--app-height) - 160px));
    inset-block: 64px;
  }
  .wallpaper .clock-stage { left: 50%; top: calc(50% - (var(--calendar-height) + 35px) / 2); }
  .calendar { left: 50%; top: calc(50% + (var(--face-size) + 35px) / 2); width: calc(var(--face-size) * 0.976); }
  .calendar-content { width: 244px; }
  .calendar-month { font-size: 16px; line-height: 22px; padding-left: 3px; margin-bottom: 10px; }
  .calendar-weekdays, .calendar-dates { column-gap: 8px; }
  .calendar-weekdays { font-size: 15px; line-height: 24px; margin-bottom: 3px; }
  .calendar-dates { row-gap: 6px; }
  .calendar-day { height: 24px; font-size: 15px; }
  .calendar-day[aria-current]::before { width: 25px; height: 25px; }
  .date-off .clock-stage { top: 50%; }
}

@media (max-width: 600px) {
  :root {
    --header-top: max(16px, env(safe-area-inset-top));
    --footer-bottom: max(12px, env(safe-area-inset-bottom));
  }
  .desktop-label { display: none; }
  .mobile-label { display: inline; }
  .header, .footer { gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .wallpaper .clock-stage, .calendar { transition: none; }
}

.theme-layer:not(.is-ready) .clock-stage,
.theme-layer:not(.is-ready) .calendar {
  transition: none;
}

@media (max-width: 600px) {
  .clock-stage {
    transform: translateY(clamp(-24px, -2vh, -8px));
  }
}

@media (orientation: landscape) and (max-height: 520px) {
  .clock-stage {
    width: min(360px, 31vw, calc(100dvh - 128px));
    transform: translateY(-10px);
  }

  :root {
    --edge-gutter: max(var(--inner-gutter), env(safe-area-inset-left), env(safe-area-inset-right));
  }
}

/* Match the supplied clock/calendar composition within the 16:9 display. */
.wallpaper {
  --face-size: 470px;
  --solo-size: 510px;
  inset: 0;
}
.wallpaper .clock-stage { left: 28%; }
.calendar { left: 75.5%; width: 367px; }
.date-off .clock-stage { left: 50%; }
.page:focus-visible { outline: 3px solid #fff; outline-offset: -8px; }
