/* shared frutiger aero chrome: tokens, glass windows, gel buttons.
   loaded by index.html and the admin page. */
@font-face {
  font-family: "Windows XP Tahoma";
  src: url("windows-xp-tahoma.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

/* ==========================================================================
   tokens — cyberspace blue, frutiger aero glass
   ========================================================================== */
:root {
  --net-blue: #0000ff;
  /* --bar-t/--bar-b: browser chrome (safari bars) the page runs underneath; measured in app.js */
  --bar-t: 0px;
  --bar-b: 0px;
  --sat: max(env(safe-area-inset-top, 0px), var(--bar-t));
  --sab: max(env(safe-area-inset-bottom, 0px), var(--bar-b));
  --net-line: #ffffff;
  --muted: #cdd0ff;
  --indigo: #2a2399;
  --sky: #3a96ff;
  --aqua: #00eaff;
  --glow: #8feaff;
  --lime: #53ff14;
  --pink: #ff5ce1;
  --xp-font: "Windows XP Tahoma", Tahoma, "MS Sans Serif", sans-serif;

  --frame: linear-gradient(90deg, rgba(42, 35, 153, 0.93) 16%, rgba(58, 150, 255, 0.93) 79%);
  --sheen: linear-gradient(
    115deg,
    rgba(255, 255, 255, 0) 24%,
    rgba(255, 255, 255, 0.17) 31%,
    rgba(255, 255, 255, 0) 43%,
    rgba(255, 255, 255, 0) 60%,
    rgba(255, 255, 255, 0.08) 65%,
    rgba(255, 255, 255, 0) 73%
  );
  --glass: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.3) 0%,
    rgba(255, 255, 255, 0.12) 45%,
    rgba(214, 226, 255, 0.15) 62%,
    rgba(255, 255, 255, 0.14) 100%
  );
  /* darker tint behind body text so white copy always clears 4.5:1 */
  --ink-wash: linear-gradient(rgba(8, 10, 120, 0.46), rgba(8, 10, 120, 0.46));
  --edge: rgba(255, 255, 255, 0.62);
  --shadow-win: 0 16px 44px rgba(0, 0, 90, 0.55), 0 0 38px rgba(70, 170, 255, 0.35);
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

button,
input,
textarea,
select,
dialog {
  font-family: var(--xp-font);
}

button {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(0, 234, 255, 0.55);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* thin glass scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.55) rgba(0, 0, 80, 0.25);
}

/* ==========================================================================
   aero window chrome — shared by every popup
   ========================================================================== */
.aero-window {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0 8px 8px;
  color: #fff;
  border: 1px solid var(--edge);
  border-radius: 12px;
  background: var(--sheen), var(--frame);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    inset 0 0 0 1px rgba(255, 255, 255, 0.1),
    var(--shadow-win);
  -webkit-backdrop-filter: blur(12px) saturate(1.5);
  backdrop-filter: blur(12px) saturate(1.5);
}

/* the glassy lit top edge */
.aero-window::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2.6rem;
  border-radius: 11px 11px 0 0;
  background: radial-gradient(130% 120% at 50% 0%, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.08) 55%, transparent 72%);
  pointer-events: none;
}

.aero-titlebar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.15rem;
  padding: 0.3rem 0 0.3rem 0.3rem;
}

.aero-titlebar[data-drag] {
  cursor: grab;
  touch-action: none;
}

.is-dragging-window .aero-titlebar[data-drag] {
  cursor: grabbing;
}

.aero-title-icon {
  flex: none;
  width: 22px;
  height: 22px;
  object-fit: contain;
  color: #fff;
  filter: drop-shadow(0 0 5px rgba(150, 230, 255, 0.9));
  pointer-events: none;
}

.aero-title {
  flex: 1;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: #fff;
  font-size: 1.3rem;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.01em;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0, 0, 100, 0.85), 0 0 12px rgba(160, 225, 255, 0.85);
}

.aero-body {
  position: relative;
  min-height: 0;
  padding: 0.5rem;
  border: 1px solid var(--edge);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), inset 0 0 26px rgba(160, 220, 255, 0.16);
}

.aero-glass {
  border: 1px solid var(--edge);
  border-radius: 7px;
  background: var(--glass), var(--ink-wash);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), inset 0 -10px 22px rgba(140, 190, 255, 0.1);
}

/* caption buttons */
.aero-controls {
  display: flex;
  align-self: flex-start;
  margin: -0.3rem 0 0;
}

.aero-btn {
  position: relative;
  width: 26px;
  height: 18px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-top: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.6) 0%, rgba(150, 185, 255, 0.4) 55%, rgba(255, 255, 255, 0.3) 100%);
  box-shadow: 0 2px 6px rgba(0, 0, 80, 0.35), inset 0 0 6px rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: filter 0.15s, box-shadow 0.15s;
}

.aero-btn + .aero-btn {
  border-left: 0;
}

.aero-btn:first-child {
  border-bottom-left-radius: 6px;
}

.aero-btn:last-child {
  border-bottom-right-radius: 6px;
}

.aero-btn:hover {
  filter: brightness(1.2);
  box-shadow: 0 2px 8px rgba(0, 0, 80, 0.4), 0 0 12px rgba(160, 235, 255, 0.9);
}

.aero-btn:active {
  filter: brightness(0.9);
}

.aero-min::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  margin: 2px 0 0 -5px;
  width: 10px;
  height: 3px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 20, 120, 0.55);
}

.aero-max::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 8px;
  margin: -4px 0 0 -5px;
  box-sizing: border-box;
  border: 2px solid #fff;
  border-top-width: 3px;
  box-shadow: 0 0 0 1px rgba(0, 20, 120, 0.55);
}

.aero-close {
  width: 42px;
  background: linear-gradient(180deg, #f7a899 0 48%, #d4452c 50%, #e9705a 100%);
}

.aero-close::before,
.aero-close::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 3px;
  height: 11px;
  margin: -5.5px 0 0 -1.5px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(110, 10, 0, 0.55);
  transform: rotate(45deg);
}

.aero-close::after {
  transform: rotate(-45deg);
}

.aero-close:hover {
  background: linear-gradient(180deg, #ffc1b4 0 48%, #ff4a2a 50%, #ff8068 100%);
  box-shadow: 0 2px 8px rgba(80, 0, 0, 0.4), 0 0 14px rgba(255, 120, 90, 0.95);
}

/* movable desktop-style windows */
.shoutbox,
.archive,
.about {
  position: fixed;
  z-index: 10;
  pointer-events: auto;
  user-select: text;
}

.shoutbox.is-open,
.archive.is-open,
.about.is-open {
  animation: win-in 0.32s var(--ease-out);
}

.shoutbox.is-min > .aero-body,
.archive.is-min > .aero-body {
  display: none;
}

.shoutbox.is-min,
.archive.is-min {
  padding-bottom: 0;
}

.shoutbox.is-front,
.archive.is-front,
.about.is-front {
  z-index: 12;
}

@keyframes win-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }
}

/* ==========================================================================
   gel buttons
   ========================================================================== */
.gel-btn {
  --g1: #9dff94;
  --g2: #22d93a;
  --g3: #0b8c20;
  --gglow: rgba(83, 255, 20, 0.55);
  --ink: rgba(0, 70, 10, 0.75);

  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35em;
  overflow: hidden;
  padding: 0.35rem 1.1rem;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  color: #fff;
  font: inherit;
  line-height: 1;
  text-shadow: 0 1px 2px var(--ink);
  background: linear-gradient(180deg, var(--g1) 0%, var(--g2) 42%, var(--g3) 78%, var(--g2) 100%);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.9),
    inset 0 -1px 2px rgba(0, 0, 0, 0.18),
    0 5px 14px rgba(0, 0, 70, 0.4),
    0 0 20px var(--gglow);
  cursor: pointer;
  transition: transform 0.15s var(--ease-out), filter 0.15s, box-shadow 0.15s;
}

/* specular dome: a wide ellipse hanging off the top edge, so the highlight's lower
   edge curves with the pill instead of reading as a flat overlay */
.gel-btn::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: -12%;
  right: -12%;
  top: -62%;
  height: 112%;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(255, 255, 255, 0.55) 55%, rgba(255, 255, 255, 0.2) 100%);
  pointer-events: none;
}

/* bounce light along the bottom rim */
.gel-btn::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: 12%;
  right: 12%;
  bottom: 0;
  height: 42%;
  background: radial-gradient(ellipse 60% 100% at 50% 100%, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
}

.gel-btn:hover {
  filter: brightness(1.1) saturate(1.1);
  transform: translateY(-1px);
}

.gel-btn:active {
  filter: brightness(0.94);
  transform: translateY(1px);
  box-shadow: inset 0 3px 8px rgba(0, 40, 0, 0.45), 0 0 14px var(--gglow);
}

.gel-btn:disabled {
  filter: grayscale(0.7) brightness(0.8);
  cursor: not-allowed;
}

.gel-aqua {
  --g1: #b6f4ff;
  --g2: #2ab4ff;
  --g3: #0868d8;
  --gglow: rgba(0, 234, 255, 0.5);
  --ink: rgba(0, 20, 110, 0.75);
}

.gel-pink {
  --g1: #ffc4f1;
  --g2: #ff5cd0;
  --g3: #bd1f9a;
  --gglow: rgba(255, 92, 225, 0.5);
  --ink: rgba(90, 0, 70, 0.75);
}

.gel-pink.is-on {
  filter: brightness(1.12);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.9), 0 0 24px rgba(255, 92, 225, 0.95);
}

.gel-small {
  padding: 0.28rem 0.8rem;
  font-size: 1.05rem;
}

