/* ===== Type ===== */
@font-face {
  font-family: "Helvetica Stencil Mod";
  src: url("assets/fonts/helvetica-stencil-mod-v1.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Granjon Roman";
  src: url("assets/fonts/Granjon-Roman.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #000;
  --muted: #6b7280;
  --faint: #9ca3af;
  --rule: #e5e7eb;
  --page: #ffffff;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

/* The site is the flexbox; the log and grain overlay sit outside its flow. */
.site {
  position: relative;
  pointer-events: none; /* lets clicks reach the log behind the centered items */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  min-height: 100vh;
}

body {
  margin: 0;
  pointer-events: none; /* lets clicks reach the layered log behind it */
  background: var(--page);
  color: var(--ink);
  font-family: Helvetica, "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  line-height: 1.4;
  letter-spacing: -0.05em;
  -webkit-font-smoothing: antialiased;
}

/* ===== Header ===== */
.site-header,
.site-footer {
  pointer-events: auto;
}

.impressum {
  pointer-events: none;
}

.impressum__line,
.impressum__panel {
  pointer-events: auto;
}

.site-header {
  padding: 10px;
}

.site-header__text {
  margin: 0;
  font-family: "Helvetica Stencil Mod", Helvetica, "Helvetica Neue", Arial, sans-serif;
  font-size: calc(10.35vw - 2px); /* fills the 20px-inset content width */
  font-weight: 400;
  letter-spacing: -0.06em;
  line-height: 0.8;
  transform: rotate(1deg);
}

/* ===== Footer ===== */
.site-footer {
  padding: 20px;
  font-family: "Granjon Roman", Georgia, serif;
  letter-spacing: normal; /* undo the body's condensed tracking */
  line-height: 1.3;
}

.site-footer__time-line {
  display: inline-block;
  white-space: nowrap; /* time, diff chip and badge stay on one desktop line */
}

.site-footer__sentence {
  display: inline-block;
  white-space: nowrap; /* wrap only between sentences */
}

.impressum {
  position: absolute;
  left: 0;
  bottom: 0;
  padding: 20px;
  font-family: "Granjon Roman", Georgia, serif;
  letter-spacing: normal;
}

.impressum__toggle {
  opacity: 1;
  transition: opacity 0.2s ease;
}

.impressum--open .impressum__toggle {
  opacity: 0.6;
}

.impressum__toggle,
.impressum__back {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.impressum__panel {
  position: absolute;
  left: 10px; /* 20px impressum padding minus 10px box padding */
  bottom: calc(100% - 18px); /* just above the toggle, past the impressum padding */
  box-sizing: border-box;
  width: min(420px, calc(100vw - 20px)); /* 10px inset on each side */
  padding: 5px 10px;
  box-shadow: inset 0 0 0 1px var(--ink);
}

.impressum__panel p {
  margin: 0 0 12px;
}

.visitor-log {
  position: absolute;
  z-index: -1; /* sits behind all other page elements */
  display: flex;
  flex-direction: column;
  top: 0;
  left: 0;
  right: 0;
  bottom: 40px; /* aligns with the impressum dropdown panel's bottom edge */
  padding: 5px 20px; /* same top/bottom padding as the dropdown */
  overflow: hidden; /* entries that leave the log area are clipped */
  font-family: "Granjon Roman", Georgia, serif;
  font-size: 13px;
  letter-spacing: normal; /* match the footer */
  line-height: 1.3;
  opacity: 0.2;
  pointer-events: auto;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, transparent 55%, rgba(0, 0, 0, 0.25) 68%, rgba(0, 0, 0, 0.75) 80%, #000 90%);
  mask-image: linear-gradient(to bottom, transparent 0%, transparent 55%, rgba(0, 0, 0, 0.25) 68%, rgba(0, 0, 0, 0.75) 80%, #000 90%);
  -webkit-user-select: none;
  user-select: none; /* the whole log is display-only */
}

.visitor-log::before {
  content: "";
  margin-top: auto; /* keeps entries pinned to the bottom until they overflow */
}

.visitor-log p {
  margin: 0;
}

.visitor-log mark {
  background: currentColor; /* mask the ID with the surrounding text color */
  color: inherit; /* match the surrounding text exactly */
  -webkit-user-select: none;
  user-select: none; /* the ID can't be selected or copied */
}

.visitor-log__id,
.visitor-log__own {
  cursor: pointer;
}

.visitor-log mark.visitor-log__name {
  color: var(--inverse); /* inherits the site's background color */
  background: var(--ink);
  padding: 0 3px;
}

.visitor-log__input {
  box-sizing: border-box;
  padding: 0 0 0 2px;
  font: inherit;
  letter-spacing: inherit;
  color: var(--inverse);
  background: var(--ink);
  border: 0;
  outline: 1px solid var(--inverse);
}

.grain-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 105vw;
  height: 105vh;
  background: url('assets/vellum-grain.gif');
  opacity: 0.1;
  mix-blend-mode: overlay;
  filter: blur(0.5px);
  pointer-events: none;
  z-index: 9999;
}

.impressum__back {
  display: block;
}

/* ===== Office Clock Widget ===== */
/* Embedded from office-clock.html; keep in sync with the standalone widget. */
.office-clock {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap; /* lets the badge drop below the clock on small screens */
  gap: 8px;
  white-space: nowrap; /* never break the clock or badge text onto a new line */
  font-family: inherit;
  vertical-align: baseline; /* share the footer text's baseline */
}

.office-clock__time {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  font-size: 13px;
  font-weight: 400;
  font-variant-numeric: tabular-nums; /* keeps digits from jittering */
  color: var(--ink);
}

.office-clock__zone {
  font-size: 13px;
  font-weight: 400;
  color: var(--ink);
}

.office-clock__status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 6px;
  font-size: 13px;
  font-weight: 400;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition: padding 0.2s ease;
  vertical-align: baseline;
  margin-left: 8px;
}

.office-clock__status:hover {
  padding: 0 10px;
}

@keyframes office-clock-pulse {
  0%, 100% { opacity: 0.15; }
  50%      { opacity: 1; }
}

.office-clock__status::before {
  content: "";
  box-sizing: border-box;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid var(--ink);
  background: transparent;
  animation: office-clock-pulse 2.2s ease-in-out infinite; /* from the radial dot array */
}

.office-clock__status--in::before {
  background: var(--ink); /* solid dot while in office */
}

/* Clicked: the badge contracts and the dot goes solid while the email
   is revealed, then both return to their resting states after the timer. */
.office-clock__status.office-clock__status--revealed {
  padding: 0 14px;
}

.office-clock__status--revealed::before {
  background: var(--ink);
  animation: none;
  opacity: 1;
}

.office-clock__diff {
  font-size: 13px;
  font-weight: 400;
  color: var(--muted); /* auxiliary info, slightly muted */
  font-variant-numeric: tabular-nums;
}

@media (max-width: 600px) {
  .visitor-log__phrase {
    display: none; /* "the directory" is dropped on small screens */
  }

  .site-footer__time-line {
    display: contents; /* keep the mobile layout exactly as before */
  }

  .office-clock__status {
    display: flex; /* block-level: own line, left-aligned with the footer */
    width: fit-content;
    margin-left: 0;
  }
}

