/**
 * base.css - Viewport Boundaries, Typography & Shell Layout
 *
 * Implements a strict 100dvh viewport-fitted container with zero vertical
 * scrolling, flexible header, and responsive pill navigation.
 */
:root {
  font-family:
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  color: #fff7e9;
  background: #211912;
  font-synthesis: none;
  -webkit-tap-highlight-color: transparent;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  height: 100dvh;
  margin: 0;
  padding: 0;
  overflow: hidden; /* Strict no-scroll constraint */
  background: radial-gradient(
    ellipse at 50% 0%,
    #57402c 0%,
    #271c15 55%,
    #1b1410 100%
  );
}

button,
select,
input {
  font: inherit;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button:disabled {
  opacity: 0.43;
  cursor: not-allowed;
}

.shell {
  height: 100%;
  height: 100dvh;
  max-width: 1440px;
  margin: 0 auto;
  padding-top: max(clamp(4px, 1vh, 12px), env(safe-area-inset-top, 4px));
  padding-bottom: max(clamp(4px, 0.8vh, 8px), env(safe-area-inset-bottom, 4px));
  padding-left: max(clamp(8px, 1.5vw, 18px), env(safe-area-inset-left, 8px));
  padding-right: max(clamp(8px, 1.5vw, 18px), env(safe-area-inset-right, 8px));
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow: hidden;
}

.top {
  flex: 0 0 auto;
  display: flex;
  gap: clamp(8px, 1.2vw, 16px);
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
  margin-bottom: clamp(4px, 0.8vh, 10px);
  min-height: 38px;
}

.brand {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1vw, 12px);
  min-width: 0;
}

.logo {
  display: grid;
  place-items: center;
  width: clamp(34px, 4.4vh, 46px);
  height: clamp(34px, 4.4vh, 46px);
  border-radius: clamp(10px, 1.4vh, 14px);
  background: #d8a05d;
  color: #402716;
  font-size: clamp(20px, 2.7vh, 26px);
  flex-shrink: 0;
}

.brand h1 {
  font-family: Georgia, serif;
  font-size: clamp(19px, 2.7vh, 28px);
  line-height: 1;
  margin: 0;
  letter-spacing: -0.5px;
  white-space: nowrap;
}

.sub {
  color: #cdbda8;
  font-size: clamp(10px, 1.3vh, 12px);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topnav {
  display: flex;
  gap: clamp(4px, 0.8vw, 8px);
  flex-wrap: nowrap;
  flex-shrink: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.topnav::-webkit-scrollbar {
  display: none;
}

.pill {
  border: 1px solid #ffffff24;
  background: #ffffff0b;
  color: #fff1db;
  border-radius: 12px;
  padding: clamp(6px, 0.9vh, 9px) clamp(8px, 1.1vw, 13px);
  font-size: clamp(11px, 1.4vh, 13px);
  white-space: nowrap;
  transition: background 0.15s;
}

.pill:hover {
  background: #ffffff18;
}

.pill.icon-pill {
  padding: clamp(4px, 0.7vh, 7px) clamp(7px, 1vw, 10px);
  font-size: clamp(13px, 1.8vh, 16px);
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}

/* Liveliness Timer Pill: Displays match uptime with second-level granularity, updating every 30s */
.pill.timer-pill {
  font-variant-numeric: tabular-nums;
  cursor: default;
  user-select: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: clamp(10px, 1.3vh, 12px);
  padding: clamp(5px, 0.8vh, 8px) clamp(7px, 1vw, 10px);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #ffeedb;
  border-color: #ffffff30;
  transition: background 0.4s ease, border-color 0.4s ease, color 0.4s ease;
}

/* Subtle heartbeat pulse indicating successful 30-second tick liveliness */
.pill.timer-pill.pulse {
  background: #f59e0b33;
  border-color: #f59e0b88;
  color: #ffe082;
}

.footer {
  flex: 0 0 auto;
  font-size: clamp(9px, 1.1vh, 10.5px);
  color: #ad9a82;
  text-align: center;
  padding: 3px 0 0;
  margin-top: auto;
}

.footer a {
  color: #f3c774;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer a:hover {
  color: #ffffff;
}

.footer-build {
  margin-top: 3px;
  font-size: clamp(8.5px, 1vh, 10px);
  color: #cdbda8;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  opacity: 0.9;
}

.build-badge {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  background: #ffffff14;
  padding: 1px 7px;
  border-radius: 6px;
  border: 1px solid #ffffff24;
  color: #f3c774;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.build-sep {
  color: #786b59;
}

.build-updated {
  color: #ad9a82;
  font-variant-numeric: tabular-nums;
}
