:root {
  --chrome-border: #2a2a2e;
  --hover-bg: #46464e;
  --hover-fg: #fff;
  --glyph: #1e1e22;
  --grain: url(images/grain.png) repeat;
  --sans-serif: Arial, sans-serif;
}

@font-face {
  font-family: "Pixelated MS Sans Serif";
  src: url(fonts/ms_sans_serif.woff2) format("woff2");
  font-weight: 400;
  font-style: normal;
}

/* ---- Base ---- */

html, body {
  height: 100%;
  margin: 0;
}

body {
  font-family: var(--sans-serif);
  font-size: 12px;
  color: #222;
}

/* ---- Window chrome ---- */

.window {
  border: 1px solid var(--chrome-border);
  background: #484840;
  font-size: 11px;
  -webkit-font-smoothing: antialiased;
}

.main-window {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  height: 100%;
}

.title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 1;
  height: 30px;
  padding: 0 4px;
  border-top: 1px solid #404044;
  font-family: "Trebuchet MS", sans-serif;
  font-size: 13px;
  background: linear-gradient(
    180deg,
    #ccccce 0%,
    #dddde8 4%,
    #92928e 8%,
    #5d5d51 11%,
    #46464a 15%,
    #48494e 26%,
    #5d6157 40%,
    #6e7772 52%,
    #878989 60%,
    #9d9d9a 66%,
    #adada5 72%,
    #bfc1b7 77%,
    #d0d5c8 82%,
    #e0e4da 89%,
    #f1f6f1 94%,
    #fbfdfc 100%
  );
  box-shadow: 0 1px 0 #c7c9c5, 0 2px 0 #80806e, 0 3px 0 #36363a, 0 4px 0 #5f5f52;
}

.title-bar-text {
  padding-left: 3px;
  margin-right: 24px;
  font-weight: bold;
  color: #000;
  text-shadow: 1px 1px 0 #d4d4d6;
}

.title-bar-controls {
  display: flex;
}

.title-bar-controls button {
  display: block;
  position: relative;
  box-sizing: border-box;
  width: 21px;
  height: 21px;
  margin-left: 2px;
  padding: 0;
  font: 11px "Pixelated MS Sans Serif", Arial;
  border: 1px solid #353539;
  border-radius: 3px;
  background: linear-gradient(
    180deg,
    #e4e7ff 0%,
    #babfce 30%,
    #9fa8b1 60%,
    #909085 100%
  );
  transition: background 100ms;
}

.title-bar-controls button:hover {
  background: linear-gradient(
    180deg,
    #f2f4ff 0%,
    #ccd1df 30%,
    #b2bac3 60%,
    #a3a396 100%
  );
}

.title-bar-controls button:not(:disabled):active {
  background: linear-gradient(
    180deg,
    #7f8790 0%,
    #8f959f 40%,
    #a0a49a 100%
  );
  box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.45);
}

.title-bar-controls button:focus {
  outline: none;
}

.title-bar-controls button:focus-visible {
  outline: 1px dotted #fff;
  outline-offset: -4px;
}

.title-bar-controls button::after {
  content: "";
  position: absolute;
}

.title-bar-controls button[aria-label="Minimize"]::after {
  left: 4px;
  top: 12px;
  width: 8px;
  height: 3px;
  background: var(--glyph);
}

.title-bar-controls button[aria-label="Maximize"]::after {
  left: 4px;
  top: 4px;
  width: 7px;
  height: 6px;
  border: 2px solid var(--glyph);
  border-top-width: 3px;
}

.title-bar-controls button[aria-label="Close"] {
  background: linear-gradient(
    180deg,
    #ff8972 0%,
    #ce4d49 20%,
    #942b33 55%,
    #792931 100%
  );
}

.title-bar-controls button[aria-label="Close"]:hover {
  background: linear-gradient(
    180deg,
    #ffa895 0%,
    #e2605a 20%,
    #a8353d 55%,
    #8c2f39 100%
  );
}

.title-bar-controls button[aria-label="Close"]:not(:disabled):active {
  background: linear-gradient(
    180deg,
    #8c3a2b 0%,
    #6b2420 20%,
    #521a1e 55%,
    #45171b 100%
  );
  box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.title-bar-controls button[aria-label="Close"]::after {
  content: "\2715";
  inset: 0;
  font-size: 13px;
  font-weight: bold;
  line-height: 19px;
  text-align: center;
  color: #fdefe8;
}

@media (prefers-reduced-motion: reduce) {
  .title-bar-controls button {
    transition: none;
  }
}

/* ---- Browser chrome ---- */

.menu-bar {
  display: flex;
  gap: 2px;
  margin: 4px 0 0;
  padding: 3px 4px;
  border-bottom: 1px solid #8b9283;
  background: #b5bfc5;
  box-shadow: 0 1px 0 #d5ddda;
  font-family: var(--sans-serif);
  font-size: 11px;
  color: #000;
  list-style: none;
}

.menu-bar li {
  padding: 2px 6px;
  cursor: default;
}

.menu-bar li:hover {
  background: var(--hover-bg);
  color: var(--hover-fg);
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 1px;
  padding: 6px 8px;
  border-bottom: 1px solid #a68d57;
  background: #ddd9d1;
}

.tool-icon {
  box-sizing: border-box;
  width: 22px;
  height: 22px;
  border: 1px dashed #8b8578;
  cursor: default;
}

.tool-icon:hover {
  border: 1px solid;
  border-color: #fff #8b8578 #8b8578 #fff;
  background: #ece9d8;
}

.address {
  flex: 1;
  box-sizing: border-box;
  max-width: 600px;
  height: 22px;
  margin-left: 8px;
  padding: 0 6px;
  border: 1px solid #5f5849;
  background: #fff;
  font-family: var(--sans-serif);
  font-size: 11px;
}

.window-body {
  flex: 1;
  min-height: 0;
  border-left: 5px solid;
  border-right: 5px solid;
  border-image: linear-gradient(
    90deg,
    #9d9774 0 40%,
    #31302b 40% 60%,
    #484840 60%
  ) 0 5 0 5;
  background:
    var(--grain),
    #1a1a16 url(images/background.jpg) center top / cover no-repeat;
  background-blend-mode: color-burn, normal;
  overflow: auto;
  scrollbar-color: #b5bfc5 #dbdbd1; 
}

.window-body::-webkit-scrollbar {
  width: 17px;
}

.window-body::-webkit-scrollbar-track {
  background: #dbdbd1;
  border-left: 1px solid #a8a596;
}

.window-body::-webkit-scrollbar-thumb {
  background: #b5bfc5;
  border: 1px solid;
  border-color: #fff #5f5849 #5f5849 #fff;
}

.window-body::-webkit-scrollbar-thumb:hover {
  background: #c8d0d5;
}

.status-bar {
  display: flex;
  box-sizing: border-box;
  height: 26px;
  padding: 3px 6px;
  border-top: 1px solid #655d4a;
  border-bottom: 3px solid #2b2b2e;
  background: #dbdbd1;
  box-shadow: inset 0 1px 0 #90895b, inset 0 2px 0 #d3d0bc;
}

.status-bar-field {
  flex-grow: 1;
  margin: 0;
  padding: 1px 2px;
  border-right: 1px solid #b8b8a3;
  border-left: 1px solid #f4f2ea;
  font-family: "Pixelated MS Sans Serif", Arial;
  color: #000;
}

.status-bar-field:first-of-type {
  border-left: none;
}

/* ---- Content column ---- */

.column {
  position: relative;
  width: 924px;
  min-height: 100%;
  margin: 0 auto;
  background: #bcbba8;
  font-family: system-ui, sans-serif;
  color: #3b2a28;
}

/* side stripes */
.column::before {
  content: "";
  position: absolute;
  inset: 4px 0 0;
  z-index: 5;
  background: linear-gradient(
    90deg,
    #4a5537 0 8px,
    #818876 8px 17px,
    transparent 17px calc(100% - 17px),
    #818876 calc(100% - 17px) calc(100% - 8px),
    #4a5537 calc(100% - 8px)
  );
  pointer-events: none;
}

/* grain overlay */
.column::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 6;
  background: var(--grain);
  mix-blend-mode: color-burn;
  pointer-events: none;
/*  animation: grain-jitter 0.4s steps(1) infinite; */
}

@keyframes grain-jitter {
  0%   { background-position: 0 0; }
  25%  { background-position: -5px 3px; }
  50%  { background-position: 4px -4px; }
  75%  { background-position: -3px -2px; }
}

@media (prefers-reduced-motion: reduce) {
  .column::after {
    animation: none;
  }
}

/* ---- Hero ---- */

.hero {
  position: relative;
  height: 485px;
  border-bottom: 23px solid #737126;
  background: url(images/hero-plaid.jpg) no-repeat;
}

/* .pin img is not affected */
.hero > img {
  position: absolute;
  display: block;
}

.hero-text {
  left: 33px;
  top: 25px;
}

.corkboard {
  left: 308px;
  top: 15px;
}

/* pins are positioned via inline style in index.html */
.pin {
  position: absolute;
  z-index: 7;
  filter: drop-shadow(1px 2px 2px rgba(0, 0, 0, 0.4));
  transition: transform 0.2s ease;
}

.hero .pin img {
  display: block;
  width: 76px;
  height: 76px;
  object-fit: contain;
  transform-origin: top center;
  animation: sway 4s ease-in-out infinite alternate;
}

/* different speeds so the pins don't sway together */
.hero .pin:nth-child(2n) img {
  animation-duration: 5s;
  animation-delay: -2s;
}

.hero .pin:nth-child(3n) img {
  animation-duration: 6s;
  animation-delay: -1s;
}

@keyframes sway {
  from { transform: rotate(-2deg); }
  to   { transform: rotate(2deg); }
}

.pin:hover {
  z-index: 8;
  transform: rotate(-10deg) scale(1.12);
}

.pin:nth-child(even):hover {
  transform: rotate(10deg) scale(1.12);
}

.progress {
  position: absolute;
  width: 500px;
}

.progress p {
  margin: 4px 0 0;
  color: #fff;
  font-size: 15px;
  font-weight: bold;
  text-shadow: 1px 1px 0 #000;
}

/* Taken from XP.css */
.progress progress {
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  display: block;
  width: 100%;
  height: 30px;
  padding: 1px 2px 1px 0;
  border: 1px solid #686868;
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
  box-shadow: inset 0 0 1px 0 #686868;
}

.progress progress::-webkit-progress-bar {
  background: transparent;
}

.progress progress::-webkit-progress-value {
  border-radius: 2px;
  background:
    repeating-linear-gradient(to right, #fff 0, #fff 2px, transparent 2px, transparent 10px),
    linear-gradient(to bottom, #acedad 0%, #7be47d 14%, #4cda50 28%, #2ed330 42%, #42d845 57%, #76e275 71%, #8fe791 85%, #fff 100%);
  animation: progress-march 1s linear infinite;
}

.progress progress::-moz-progress-bar {
  border-radius: 2px;
  background:
    repeating-linear-gradient(to right, #fff 0, #fff 2px, transparent 2px, transparent 10px),
    linear-gradient(to bottom, #acedad 0%, #7be47d 14%, #4cda50 28%, #2ed330 42%, #42d845 57%, #76e275 71%, #8fe791 85%, #fff 100%);
  animation: progress-march 1s linear infinite;
}

@keyframes progress-march {
  to { background-position: 10px 0; }
}

@media (prefers-reduced-motion: reduce) {
  .hero .pin img,
  .progress progress::-webkit-progress-value,
  .progress progress::-moz-progress-bar {
    animation: none;
  }
}

/* ---- Panels ---- */

.mid {
  display: flex;
  align-items: flex-start;
  padding: 0 0 40px 13px;
}

.panel {
  flex: none;
  box-sizing: border-box;
  min-height: 450px;
  background: #e8e5da;
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #a8a596;
}

.panel-left {
  width: 219px;
  margin-top: 24px;
  padding: 8px;
}

.panel-main {
  width: 424px;
  margin: 54px 0 0 18px;
  padding: 12px 16px 16px;
  font-size: 14px;
  line-height: 1.5;
}

.panel-main .welcome {
  display: block;
  margin: 0 0 12px -11px;
}

.panel-main p {
  margin: 0 0 1em;
}

.panel-right {
  width: 225px;
  margin: 22px 0 0 16px;
  padding: 8px 12px 8px 8px;
}

.panel h3 {
  margin: 12px 0 6px;
  font-size: 13px;
}

.item {
  margin-bottom: 6px;
  padding: 5px 7px;
  border: 1px solid #a8a596;
  background: #f4f2ea;
  box-shadow: inset 1px 1px 0 #fff;
}

.item b {
  display: block;
  font-size: 12px;
}

.item p {
  margin: 2px 0 0;
  font-size: 11px;
  color: #6b5a58;
}

.credit {
  display: flex;
  align-items: center;
  gap: 7px;
  color: inherit;
  text-decoration: none;
}

.credit:hover {
  background: #fff;
}

.credit .frame {
  flex: none;
  width: 38px;
  height: 38px;
  border: 1px solid #a8a596;
  background: #fff;
  box-shadow: inset 1px 1px 0 #d9d6c8;
}

.credit .frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---- Accordions ---- */

.accordion {
  margin: 0 0 6px;
}

.accordion summary {
  cursor: pointer;
  list-style: none;
  color: #c00;
  text-decoration: underline;
}

.accordion summary::-webkit-details-marker {
  display: none;
}

/* ---- Calendar ---- */

.calendar {
  border: 1px solid var(--chrome-border);
  background: #fff;
  font-family: var(--sans-serif);
  font-size: 11px;
  color: #000;
}

.calendar .title-bar {
  height: 24px;
}

.calendar table {
  width: 100%;
  margin-top: 4px;
  border-collapse: collapse;
  text-align: center;
}

.calendar th {
  padding: 4px 0 2px;
  border-bottom: 1px solid #808080;
  font-weight: normal;
  color: #000;
}

.calendar td {
  height: 22px;
  cursor: default;
}

.calendar td:hover {
  background: var(--hover-bg);
  color: var(--hover-fg);
}

/* added by script.js */
.calendar .today {
  outline: 2px solid #000;
  outline-offset: -2px;
}

.calendar .debut   { background: #ffe28a; }
.calendar .vote    { background: #d9c8f0; }
.calendar .comms   { background: #bcd8f5; }
.calendar .fanart  { background: #b8e8e0; }
.calendar .charity { background: #c5eab5; }
.calendar .games   { background: #f8c8dc; }
/* black X */
.calendar .nostream {
  background:
    linear-gradient(to top right, transparent 46%, #000 46%, #000 54%, transparent 54%),
    linear-gradient(to top left,  transparent 46%, #000 46%, #000 54%, transparent 54%);
}

.calendar .legend {
  margin: 6px 0 0;
  padding: 6px 6px 4px;
  border-top: 1px solid #808080;
  list-style: none;
}

.calendar .legend li {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 2px;
}

.calendar .legend span {
  width: 10px;
  height: 10px;
  border: 1px solid #808080;
  flex-shrink: 0;
}

.calendar .note {
  margin: 0;
  padding: 0 6px 6px;
  font-style: italic;
  color: #808080;
}

/* ---- Buddy ---- */

.buddy {
  position: fixed;
  right: 20px;
  bottom: 30px;
  width: 160px;
  height: 160px;
}
