/* kohler.land island: the page around the 3D view */
:root {
  --ink: #16202e;
  --muted: #5a6677;
  --glass: rgba(255, 255, 255, 0.7);
  --line: rgba(255, 255, 255, 0.85);
  --font: "Inter", system-ui, sans-serif;
  --serif: "Fraunces", Georgia, serif;
}
body.night {
  --glass: rgba(16, 22, 38, 0.62);
  --line: rgba(255, 255, 255, 0.12);
  --ink: #eef2fb;
  --muted: #a3afc7;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
}
body {
  font-family: var(--font);
  color: var(--ink);
  overflow: hidden;
  background: #a9cde3;
}
a {
  color: inherit;
}
:focus-visible {
  outline: 3px solid #ffb703;
  outline-offset: 2px;
}
canvas#gl {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}
/* for screen readers only; the skip button shows itself when it gets the keyboard focus */
.sr-only,
.skip:not(:focus) {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.skip {
  padding: 9px 15px;
  border-radius: 999px;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
}
.glass {
  background: var(--glass);
  backdrop-filter: blur(16px) saturate(1.5);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  border: 1px solid var(--line);
  box-shadow: 0 12px 34px -14px rgba(10, 30, 60, 0.45);
}
body,
.glass {
  transition:
    background-color 1s,
    color 1s;
}

/* header: logo and residents */
header {
  position: fixed;
  top: 16px;
  left: 16px;
  right: 16px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  z-index: 5;
  pointer-events: none;
}
header > * {
  pointer-events: auto;
}
.logo {
  padding: 9px 18px;
  border-radius: 999px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 20px;
}
.logo small {
  font-family: var(--font);
  font-weight: 400;
  color: var(--muted);
  font-size: 13px;
  margin-left: 8px;
}
nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
nav a {
  text-decoration: none;
  padding: 9px 15px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 15px;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--ink);
}
nav a i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.7);
}
nav a[aria-current="page"] {
  background: var(--ink);
  color: #fff;
}
body.night nav a[aria-current="page"] {
  color: #16202e;
}

/* tags that follow houses and lanterns, and the pointer tooltip */
.tags {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  overflow: hidden;
}
.tag {
  position: absolute;
  left: 0;
  top: 0;
  padding: 5px 12px 5px 8px;
  border-radius: 99px;
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  display: flex;
  gap: 6px;
  align-items: center;
  transition: opacity 0.4s;
}
.tag i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--c);
}
a.ltag {
  pointer-events: auto;
  text-decoration: none;
  position: absolute;
  left: 0;
  top: 0;
  padding: 5px 12px 5px 6px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  gap: 8px;
  align-items: center;
  white-space: nowrap;
  transition: opacity 0.4s;
  color: var(--ink);
}
a.ltag span {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--c);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
}
.tip {
  position: fixed;
  z-index: 6;
  pointer-events: none;
  padding: 7px 12px;
  border-radius: 12px;
  font-size: 13px;
  opacity: 0;
  transform: translate(14px, 14px);
  transition: opacity 0.15s;
}
.tip.on {
  opacity: 1;
}
.tip small {
  display: block;
  color: var(--muted);
}

/* resident details panel */
.panel {
  position: fixed;
  right: 16px;
  top: 82px;
  width: 370px;
  max-height: calc(100% - 82px - var(--bar, 58px) - 32px);
  overflow: auto;
  border-radius: 22px;
  padding: 22px;
  z-index: 5;
  transform: translateX(calc(100% + 40px));
  transition: transform 0.8s cubic-bezier(0.5, 0, 0.15, 1);
}
.panel.open {
  transform: none;
}
.panel .close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.85);
  font: inherit;
  font-size: 16px;
  cursor: pointer;
  color: #16202e;
}
.panel .badge {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.panel .badge i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c);
}
.panel h2 {
  margin: 6px 0 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 30px;
  line-height: 1.1;
}
.panel .role {
  color: var(--muted);
  margin: 6px 0 16px;
  font-size: 15px;
}
.panel h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 18px 0 8px;
  font-weight: 600;
}
.panel a.l {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 10px;
  align-items: center;
  background: rgba(255, 255, 255, 0.85);
  color: #16202e;
  border-radius: 14px;
  padding: 10px 12px;
  margin-bottom: 8px;
  text-decoration: none;
  transition: transform 0.2s;
}
.panel a.l:hover {
  transform: translateX(4px);
}
.panel a.l .ic {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--c);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}
.panel a.l small {
  display: block;
  color: #5a6677;
}
.panel ol {
  list-style: none;
  margin: 0;
  padding: 0;
}
.panel li {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 8px;
  padding: 7px 0;
  border-top: 1px solid rgba(127, 127, 127, 0.18);
  font-size: 14px;
}
.panel li b {
  color: var(--c);
  font-weight: 600;
}

/* season buttons and time slider */
.time {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 5;
  padding: 10px 16px;
  border-radius: 18px;
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 13px;
}
.time output {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  min-width: 44px;
}
.time input {
  width: 180px;
  accent-color: #f4a261;
}
.time label {
  display: flex;
  gap: 12px;
  align-items: center;
}
/* Live: lit while the island follows the real clock */
.time .live {
  border: 0;
  border-radius: 999px;
  padding: 5px 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  background: rgba(127, 127, 127, 0.18);
  color: var(--muted);
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.time .live::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.5;
}
.time .live[aria-pressed="true"] {
  background: #e8f6ec;
  color: #1f7a3d;
}
.time .live[aria-pressed="true"]::before {
  opacity: 1;
  background: #2fb35a;
}
.time .share::before {
  display: none;
}
.time .acts {
  display: flex;
  gap: 6px;
}
.seasons {
  display: flex;
  gap: 2px;
  padding-right: 10px;
  border-right: 1px solid rgba(127, 127, 127, 0.3);
}
.seasons button {
  border: 0;
  background: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 15px;
  cursor: pointer;
  opacity: 0.5;
  filter: grayscale(0.7);
  transition:
    opacity 0.2s,
    background 0.2s;
}
.seasons button:hover {
  opacity: 0.85;
}
.seasons button[aria-pressed="true"] {
  opacity: 1;
  filter: none;
  background: rgba(255, 255, 255, 0.75);
}

/* Sally's card, which follows her */
.catcard {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 4;
  width: 250px;
  padding: 14px 16px 12px;
  border-radius: 18px;
  font-size: 13px;
  transform: translate(-50%, calc(-100% - 10px));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.catcard.open {
  opacity: 1;
  pointer-events: auto;
}
.catcard h4 {
  margin: 0 0 2px;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
}
.catcard p {
  margin: 0 0 8px;
  color: var(--muted);
}
.catcard dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 10px;
  margin: 0;
}
.catcard dt {
  color: var(--muted);
}
.catcard dd {
  margin: 0;
  font-weight: 500;
}
.catcard .close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  font: inherit;
  color: #16202e;
}

/* how-to hint and the loading veil */
.hint {
  position: fixed;
  left: 16px;
  bottom: 16px;
  padding: 8px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.45;
  z-index: 5;
}
/* the hint wraps beside the time controls, and steps aside when there is no room */
.hint {
  max-width: calc(100vw - 680px);
}
@media (max-width: 1000px) {
  .hint {
    display: none;
  }
}
.veil {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: linear-gradient(#7fb6dc, #e6f1f7);
  transition:
    opacity 1.2s,
    visibility 1.2s;
}
.veil.gone {
  opacity: 0;
  visibility: hidden;
}
.veil b {
  display: block;
  font-family: var(--serif);
  font-size: 46px;
  font-weight: 600;
  color: #fff;
  text-align: center;
}
.veil span {
  display: block;
  text-align: center;
  color: #fff;
  animation: breathe 1.6s ease-in-out infinite;
}
@keyframes breathe {
  50% {
    opacity: 0.4;
  }
}

/* phones */
@media (max-width: 700px) {
  header {
    top: 10px;
    left: 10px;
    right: 10px;
  }
  .logo small,
  .hint {
    display: none;
  }
  nav a {
    padding: 7px 11px;
    font-size: 13px;
  }
  /* the panel slides up from below the time controls, and hides fully off screen */
  .panel {
    left: 10px;
    right: 10px;
    top: auto;
    bottom: calc(var(--bar, 96px) + 26px);
    width: auto;
    max-height: 46vh;
    transform: translateY(calc(100% + var(--bar, 96px) + 40px));
  }
  .time {
    left: 10px;
    right: 10px;
    bottom: 10px;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }
  .time input {
    flex: 1;
    width: auto;
  }
  .time label {
    width: 100%;
  }
  .time .acts {
    align-self: center;
  }
  .seasons {
    justify-content: space-around;
    border-right: 0;
    padding-right: 0;
  }
}
