/* ============================================
   altalenae — retro desktop / Neocities style
   ============================================ */

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background-color: #ffffff;
  background-image:
    radial-gradient(circle, #999 1px, transparent 1px);
  background-size: 4px 4px;
  font-family: "Courier New", Courier, monospace;
  color: #000;
}

a {
  color: #0000ee;
  text-decoration: underline;
}

a:visited {
  color: #0000ee;
}

/* ---------- top nav ---------- */

.topnav {
  background: #fff;
  border-bottom: 3px solid #000;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 32px;
  font-weight: bold;
  font-size: 1.15rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topnav a {
  color: #000;
  text-decoration: none;
}

.topnav a:hover {
  text-decoration: underline;
}

.topnav .star {
  font-size: 1.3rem;
  margin-right: 8px;
}

/* ---------- desk layout ---------- */

.desk {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 22px;
  padding: 28px;
  max-width: 1700px;
  margin: 0 auto;
}

/* ---------- generic window chrome ---------- */

.window {
  background: #fff;
  border: 2px solid #000;
  box-shadow: 5px 5px 0 rgba(0,0,0,0.15);
}

.titlebar {
  display: flex;
  align-items: center;
  border-bottom: 2px solid #000;
  height: 30px;
  padding: 0 6px;
  gap: 6px;
  background: #fff;
}

.tb-box {
  width: 14px;
  height: 14px;
  border: 2px solid #000;
  flex-shrink: 0;
}

.tb-folder {
  width: 16px;
  height: 16px;
  border: 2px solid #000;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  line-height: 1;
}

.tb-stripes {
  flex: 1;
  height: 14px;
  background: repeating-linear-gradient(
    to bottom,
    #000 0,
    #000 2px,
    #fff 2px,
    #fff 4px
  );
}

.tb-title {
  font-weight: bold;
  font-size: 1.05rem;
  white-space: nowrap;
  padding: 0 6px;
  flex: 0 0 auto;
}

.content {
  padding: 18px 20px;
  line-height: 1.5;
}

/* ---------- hello window (left column, top) ---------- */

.hello {
  width: 340px;
}

.hello p {
  margin: 0 0 14px 0;
}

.hello .sign {
  margin-top: 20px;
}

/* ---------- hypertext diagram window ---------- */

.hypertext {
  width: 340px;
}

.source-line {
  font-weight: bold;
  margin: 0 0 10px 0;
  font-size: 0.95rem;
}

.fig-title {
  font-size: 1.5rem;
  margin: 6px 0 18px 0;
  letter-spacing: 1px;
}

.hypertext-diagram {
  width: 100%;
  height: auto;
}

.fig-caption {
  text-align: right;
  font-style: italic;
  margin: 8px 0 0 0;
  font-size: 0.9rem;
}

/* ---------- updates window ---------- */

.updates {
  width: 340px;
}

.updates-list ul {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 260px;
  overflow-y: auto;
}

.updates-list li {
  padding: 3px 0;
  font-size: 0.95rem;
}

.updates-list .date {
  font-weight: bold;
  margin-right: 6px;
}

/* ---------- home card (center, main feature) ---------- */

.homecard {
  width: 1200px;
  flex: 1 1 640px;
  transform: rotate(0.2deg);
}

.homecard .titlebar {
  height: 34px;
}

.homecard .tb-title {
  font-size: 1.7rem;
}

.homecard .content {
  padding: 40px 50px 30px;
}

.icon-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  row-gap: 34px;
  column-gap: 10px;
  text-align: center;
}

.icon-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #000;
}

.icon-item .icon {
  font-size: 2.6rem;
  line-height: 1;
  filter: grayscale(1) contrast(1.2);
}

.icon-item .label {
  font-size: 1.05rem;
}

.icon-item:hover .label {
  text-decoration: underline;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 34px;
  font-size: 1.1rem;
}

.pager-arrow {
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: #000;
}

/* ---------- confusion / osage right-column windows ---------- */

.confusion, .osage {
  width: 340px;
}

.spiral-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.spiral-item {
  position: relative;
  border: 1px solid #ccc;
}

.spiral-item svg {
  width: 100%;
  height: auto;
  display: block;
}

.spiral-item .num {
  position: absolute;
  bottom: 4px;
  right: 8px;
  font-size: 0.85rem;
}

.hands-diagram {
  width: 100%;
  height: auto;
}

/* ---------- badge row ---------- */

.badge-row {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0;
}

.badge {
  width: 88px;
  height: 31px;
  border: 1px solid #000;
  background: #eee;
  color: #000;
  text-decoration: none;
  font-size: 0.6rem;
  font-weight: bold;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.1;
  padding: 2px;
}

.badge small {
  font-weight: normal;
  font-size: 0.85em;
}

.flag-badge {
  background: repeating-linear-gradient(
    to bottom,
    #000 0%, #000 20%,
    #a3a3a3 20%, #a3a3a3 40%,
    #fff 40%, #fff 60%,
    #d60270 60%, #d60270 80%,
    #9b59b6 80%, #9b59b6 100%
  );
  color: #000;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff;
}

/* ---------- status window ---------- */

.status {
  width: 610px;
}

.status .status-name {
  font-weight: bold;
}

.status .status-time {
  color: #555;
  font-size: 0.9rem;
}

/* ---------- webrings window ---------- */

.webrings {
  width: 460px;
}

.webring-content {
  text-align: center;
}

.webring-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin: 18px 0;
}

.webring-swatch {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red);
  border: 2px solid #000;
}

.webring-links {
  margin-top: 10px;
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .desk {
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
  }

  .hello, .hypertext, .updates, .confusion, .osage, .status, .webrings {
    width: 100%;
  }

  .homecard {
    width: 100%;
  }

  .icon-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .topnav {
    flex-wrap: wrap;
    gap: 16px;
  }
}