/* grayscale & pastel */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;600;700&display=swap');

:root {
  --background: #1a1a1a;
  --component: #323232;
  --lightgray: #737373;
  --border: #808080;
  --text: #eff1f5;

  --pink: #f7d2d9;
  --green: #86ce86;
  --lavender: #bfaef1;
  --blue: #81c0e9;
  --orange:#e8bc7e;
  --red: #e77e79;

  /* sidebar collapse tab width: square, matches the hub chip's height */
  --tabw: clamp(1.76rem, 2.5vw, 2.2rem);
  /* sidebar width, shared by every app: 180px up to ~1400px windows, then grows gently */
  --sbw: clamp(180px, 13vw, 260px);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  min-height: 100vh;
  /* to make text big and cause im 21 when writing this */
  font-size: 21px;
  font-family: 'Space Grotesk', sans-serif;
  display: flex;
  background-color: var(--background);
  color: var(--text);
  /* for no horizontal scroll bar */
  overflow-x: hidden;
}

body {
  padding: 0.5rem;
}

ul {
  list-style: none;
}

a {
  text-decoration: none;
  color: var(--blue);
}

a:visited {
  color: var(--blue);
}

a:hover {
  color: var(--lavender);
}

/* every button everywhere gets the same light-gray hover — you can always tell it's clickable */
button:hover {
  background: var(--lightgray);
}

/* the hub chip: the same small button in the top-left of every page — orange text marks the way home */
#home, .home-link, #home:visited, .home-link:visited {
  display: block;
  width: 4rem;
  padding: 0.4rem 0;
  background: var(--component);
  color: var(--orange);
  text-align: center;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
}

#home:hover, .home-link:hover {
  background: var(--lightgray);
  color: var(--orange);
}

/* sidebar collapse tab: a small fixed button at the sidebar's top right, right of the hub chip.
   collapsed: sidebar fully disappears, tab slides to the screen's top-left corner (see FabSidebar component) */
#side-tab {
  position: fixed;
  /* 1rem = body padding + sidebar padding: sits exactly level with the hub chip */
  top: 1rem;
  left: calc(var(--sbw) - var(--tabw) - 0.6rem);
  width: var(--tabw);
  padding: 0.4rem 0;
  background: var(--component);
  color: var(--border);
  border-radius: 8px;
  font-size: 0.8rem;
  text-align: center;
  cursor: pointer;
  user-select: none;
  z-index: 50;
  transition: left 0.15s;
}

body.sidebar-collapsed #side-tab {
  left: 0.6rem;
}

/* css triangle — phone fonts render the arrow glyphs as emojis, borders don't */
#side-tab .tri {
  display: inline-block;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-right: 7px solid var(--border);
}

body.sidebar-collapsed #side-tab .tri {
  transform: scaleX(-1);
}

#side-tab:hover {
  background: var(--lightgray);
  color: var(--text);
}

/* phones: wider sidebar share, since it overlays the page anyway */
@media (max-width: 700px) {
  :root {
    --sbw: min(60vw, 260px);
  }
}
