:root {
  --bg: #1c222c;
  --deep: #12161f;
  --card: rgba(48, 58, 74, .76);
  --solid: #38445a;
  --border: rgba(220, 229, 245, .16);
  --text: #f6f8fc;
  --muted: #b7c2d3;
  --blue: #7aa9ff;
  --blue2: #4f80ec;
  --good: #5ad175;
  --bad: #ef5f5f;
  --shadow: 0 20px 60px rgba(0, 0, 0, .32);
  --r: 24px;
}

body.light {
  --bg: #eef3fb;
  --deep: #dce7f5;
  --card: rgba(255, 255, 255, .85);
  --solid: #fff;
  --border: rgba(18, 53, 98, .16);
  --text: #132038;
  --muted: #3d5069;
  --blue: #1457c9;
  --blue2: #0f4cb8;
  --shadow: 0 16px 46px rgba(40, 72, 120, .15);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: Inter, system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
}

.bg {
  position: fixed;
  z-index: -3;
  inset: 0;
  overflow: hidden;
  background: linear-gradient(135deg, var(--deep), var(--bg));
}

.bg i {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .32;
}

.bg i:nth-child(1) {
  top: -14vw;
  left: -13vw;
  width: 44vw;
  height: 44vw;
  background: #5375d6;
  animation: moveA 20s ease-in-out infinite;
}

.bg i:nth-child(2) {
  right: -9vw;
  bottom: -10vw;
  width: 36vw;
  height: 36vw;
  background: #25a2b9;
  animation: moveB 24s ease-in-out infinite;
}

.bg i:nth-child(3) {
  top: 44%;
  left: 48%;
  width: 24vw;
  height: 24vw;
  background: #7f4fc4;
  animation: moveC 26s ease-in-out infinite;
}

@keyframes moveA {
  50% {
    transform: translate(9vw, 7vh) scale(1.14);
  }
}

@keyframes moveB {
  50% {
    transform: translate(-8vw, -6vh) scale(1.13);
  }
}

@keyframes moveC {
  50% {
    transform: translate(-6vw, 6vh) scale(1.18);
  }
}

.hero-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(1200px, calc(100% - 28px));
  height: 88px;
  margin: 8px auto 0;
  padding: 0 24px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  background-clip: padding-box;
  background-color: rgba(10, 14, 28, .60);
  background-image:
    linear-gradient(135deg, rgba(8, 12, 26, .78), rgba(35, 50, 100, .50)),
    url("assets/img/header-bg.jpg");
  background-size: cover;
  background-position: center 35%;
  background-repeat: no-repeat;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(170%);
}

.home-page .hero-header {
  height: 110px;
  padding: 0 28px;
}

body.light .hero-header {
  background-color: rgba(255, 255, 255, .55);
  background-image:
    linear-gradient(135deg, rgba(255, 255, 255, .78), rgba(220, 230, 250, .50)),
    url("assets/img/header-bg.jpg");
}

.logo {
  color: #fff;
  font-weight: 800;
  letter-spacing: -.04em;
  text-decoration: none;
}

.logo strong {
  color: var(--blue);
}

body.light .logo {
  color: var(--text);
}

.back {
  color: rgba(255, 255, 255, .82);
  font-size: .82rem;
  text-decoration: none;
}

body.light .back {
  color: var(--muted);
}

#theme {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, .14);
  font-size: .76rem;
  font-weight: 700;
  cursor: pointer;
}

body.light #theme {
  color: var(--text);
  background: rgba(255, 255, 255, .60);
}

.home,
.page,
.subjectpage {
  width: min(880px, calc(100% - 28px));
  margin: 0 auto;
}

.home {
  padding: 6vh 0 110px;
}

.home-page .home {
  padding: 8vh 0 140px;
}

.hero {
  max-width: 700px;
  margin: 34px auto 46px;
}

.hero small,
.heading small,
.group small,
.block small,
.subjecthero small,
.modal small,
.experience-invite small {
  color: var(--blue);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .15em;
}

.hero h1 {
  margin: 14px 0 0;
  font-size: clamp(2.9rem, 7vw, 5.6rem);
  line-height: .98;
  letter-spacing: -.06em;
}

mark {
  color: var(--blue);
  background: transparent;
}

.hero .materials-count {
  margin: 0.7rem 0 1.2rem;
  font-size: 0.95rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.hero .materials-count strong {
  color: var(--text);
  font-weight: 700;
}

.years-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 700px;
  margin: 0 auto;
}

.home-page .years-stack .year-tile {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity .5s ease,
    transform .5s cubic-bezier(.2, .8, .2, 1);
  overflow: hidden;
}

.home-page.loaded .years-stack .year-tile {
  opacity: 1;
  transform: translateY(0);
}

.home-page.loaded .years-stack .year-tile:nth-child(1) { transition-delay: 0s; }
.home-page.loaded .years-stack .year-tile:nth-child(2) { transition-delay: .12s; }
.home-page.loaded .years-stack .year-tile:nth-child(3) { transition-delay: .24s; }
.home-page.loaded .years-stack .year-tile:nth-child(4) { transition-delay: .36s; }
.home-page.loaded .years-stack .year-tile:nth-child(5) { transition-delay: .48s; }

.tile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 120px;
  padding: 30px 32px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  background: var(--card);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: .35s;
}

.tile:hover {
  transform: translateX(6px);
  border-color: var(--blue);
  background: var(--solid);
}

.tile h2 {
  margin: 0;
  font-size: 1.5rem;
  letter-spacing: -.03em;
}

.tile span {
  color: var(--blue);
  font-size: .8rem;
  font-weight: 800;
}

.home-page .tile.year-tile {
  position: relative;
  z-index: 0;
  overflow: hidden;
  border-radius: var(--r);
  background-color: rgba(23, 31, 50, .48);
  -webkit-clip-path: inset(0 round var(--r));
  clip-path: inset(0 round var(--r));
}

.home-page .tile.year-tile::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: calc(-1 * var(--tile-top, 0px));
  height: var(--stack-height, 100%);
  background-image:
    linear-gradient(135deg, rgba(8, 13, 27, .52), rgba(37, 56, 104, .32)),
    url("assets/img/godine-bg.jpg");
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  filter: blur(7px);
  z-index: 0;
}

.home-page .tile.year-tile h2,
.home-page .tile.year-tile span {
  position: relative;
  z-index: 1;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .60);
}

.home-page .tile.year-tile:hover {
  border-color: var(--blue);
  background-color: rgba(36, 51, 82, .34);
}

body.light .home-page .tile.year-tile::before {
  background-image:
    linear-gradient(135deg, rgba(255, 255, 255, .85), rgba(235, 242, 255, .75)),
    url("assets/img/godine-bg.jpg");
  background-blend-mode: screen;
}

body.light .home-page .tile.year-tile h2,
body.light .home-page .tile.year-tile span {
  color: #0b1220;
  text-shadow: 0 1px 14px rgba(255, 255, 255, .9);
}

body.light .home-page .tile.year-tile span {
  color: #0f4cb8;
}

.roman-columns {
  display: none;
}

.terms-page-body .roman-columns {
  position: fixed;
  z-index: -1;
  display: block;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.terms-page-body .roman-columns::before,
.terms-page-body .roman-columns::after {
  position: absolute;
  top: 104px;
  bottom: 32px;
  width: min(108px, 8vw);
  min-width: 74px;
  border: 1px solid rgba(220, 229, 245, .11);
  border-radius: 18px;
  content: "";
  opacity: .78;
  background-color: rgba(10, 16, 29, .52);
  background-image: url("assets/img/columns.svg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  box-shadow: inset 0 0 45px rgba(9, 15, 28, .42);
}

.terms-page-body .roman-columns::before {
  left: clamp(12px, 1.4vw, 28px);
}

.terms-page-body .roman-columns::after {
  right: clamp(12px, 1.4vw, 28px);
  transform: scaleX(-1);
}

body.light .terms-page-body .roman-columns::before,
body.light .terms-page-body .roman-columns::after {
  border-color: rgba(18, 53, 98, .16);
  background-color: rgba(220, 230, 247, .44);
  box-shadow: inset 0 0 42px rgba(89, 119, 166, .13);
}

.page {
  padding: 44px 0 100px;
}

.heading h1 {
  margin: 0;
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -.02em;
}

.search {
  display: block;
  max-width: 520px;
  margin: 28px 0 30px;
  color: var(--muted);
  font-size: .76rem;
}

.search input {
  display: block;
  width: 100%;
  margin-top: 7px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  background: var(--solid);
  outline: 0;
}

.group {
  margin-top: 34px;
}

.subjects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.subject {
  position: relative;
  padding: 20px 50px 20px 20px;
  border: 1px solid var(--border);
  border-radius: 18px;
  color: var(--text);
  background: var(--card);
  box-shadow: var(--shadow);
  text-decoration: none;
  opacity: 0;
  transform: translateY(14px);
  transition: .3s;
}

.subject.show {
  opacity: 1;
  transform: none;
}

.subject:hover {
  transform: translateY(-4px);
  background: var(--solid);
}

.subject h2 {
  margin: 0;
  font-size: .95rem;
  line-height: 1.35;
}

.subject span {
  position: absolute;
  top: 50%;
  right: 18px;
  color: var(--blue);
  font-size: 1.3rem;
  transform: translateY(-50%);
}

@keyframes difficultSubjectGlow {
  0%, 70%, 100% {
    border-color: var(--border);
    background-color: var(--card);
    box-shadow: var(--shadow);
  }

  78%, 92% {
    border-color: rgba(245, 117, 117, .52);
    background-color: rgba(130, 45, 55, .20);
    box-shadow: 0 0 0 1px rgba(245, 100, 100, .15), 0 16px 48px rgba(130, 35, 40, .18);
  }
}

.subject.difficult {
  animation: difficultSubjectGlow 8s ease-in-out infinite;
}

.subject.difficult:nth-child(2) {
  animation-delay: .55s;
}

.subjectpage {
  padding: 24px 0 105px;
}

.subjecthero,
.block {
  margin-top: 18px;
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--card);
  box-shadow: var(--shadow);
}

.subjecthero {
  margin-top: 0;
}

.subjecthero h1 {
  margin: 12px 0 0;
  font-size: clamp(2.2rem, 5.5vw, 3.6rem);
  letter-spacing: -.045em;
}

.block h2 {
  margin: 8px 0 0;
  font-size: 1.35rem;
  letter-spacing: -.03em;
}

.subsection {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.subsection h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
  letter-spacing: -.02em;
  color: var(--text);
}

.block > div:not(.tabs) {
  margin-top: 20px;
}

.material {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 9px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 15px;
}

.material h3 {
  margin: 0 0 4px;
  font-size: .88rem;
}

.material p {
  margin: 0;
  color: var(--muted);
  font-size: .7rem;
}

.material-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.material a {
  padding: 8px 12px;
  border-radius: 10px;
  color: #fff;
  background: var(--blue2);
  font-size: .74rem;
  font-weight: 800;
  text-decoration: none;
}

.votes {
  display: inline-flex;
  align-items: center;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.vote-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 32px;
  padding: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.vote-button:hover {
  background: rgba(255, 255, 255, .06);
  color: var(--text);
}

body.light .vote-button:hover {
  background: rgba(0, 0, 0, .05);
}

.vote-button.up.active {
  color: var(--good);
  background: rgba(90, 209, 117, .16);
}

.vote-button.down.active {
  color: var(--bad);
  background: rgba(239, 95, 95, .16);
}

.vote-count {
  min-width: 30px;
  padding: 0 6px;
  color: var(--text);
  font-size: .78rem;
  font-weight: 800;
  text-align: center;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  background: rgba(255, 255, 255, .03);
}

body.light .vote-count {
  background: rgba(0, 0, 0, .03);
}

.comment-button,
.experience-comment-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  background: transparent;
  font-size: .74rem;
  font-weight: 800;
  cursor: pointer;
}

.comment-button:hover,
.experience-comment-button:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.comment-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  color: #fff;
  background: var(--blue2);
  font-size: .68rem;
  font-weight: 800;
  line-height: 1;
}

.empty {
  color: var(--muted);
}

.tabs {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}

.tabs button {
  flex: 1;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--muted);
  background: transparent;
  font-weight: 700;
  cursor: pointer;
}

.tabs button.active {
  border-color: transparent;
  color: #fff;
  background: var(--blue2);
}

.explist {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.expcard,
.commentcard {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: rgba(255, 255, 255, .03);
  animation: experienceSlideIn .45s cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes experienceSlideIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.expcard .head,
.commentcard .head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--blue);
  font-size: .78rem;
  font-weight: 700;
}

.expcard .prof {
  margin-top: 6px;
  color: var(--muted);
  font-size: .8rem;
}

.expcard .body,
.commentcard .body {
  margin-top: 8px;
  font-size: .86rem;
  line-height: 1.55;
}

.experience-rating {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  color: var(--blue);
  font-size: .78rem;
  font-weight: 700;
}

.experience-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 13px;
}

.delete-own-button {
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  font-size: .9rem;
  line-height: 1;
  cursor: pointer;
}

.delete-own-button:hover {
  border-color: rgba(245, 117, 117, .50);
  color: #f78282;
  background: rgba(180, 50, 50, .10);
}

.experience-invite {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-top: 18px;
  padding: 28px 32px;
  border: 1px solid rgba(122, 169, 255, .35);
  border-radius: var(--r);
  background:
    linear-gradient(135deg, rgba(71, 111, 214, .28), rgba(106, 70, 164, .22)),
    var(--card);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .3s, border-color .3s, background .3s;
}

.experience-invite:hover {
  border-color: var(--blue);
  background:
    linear-gradient(135deg, rgba(71, 111, 214, .40), rgba(106, 70, 164, .34)),
    var(--solid);
  transform: translateY(-4px);
}

.experience-invite h2 {
  margin: 8px 0 0;
  font-size: 1.3rem;
  letter-spacing: -.03em;
}

.experience-invite p {
  max-width: 620px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: .86rem;
  line-height: 1.55;
}

.experience-invite > span {
  color: var(--blue);
  font-size: 2rem;
  font-weight: 700;
}

.publish-rule {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid rgba(122, 169, 255, .30);
  border-radius: 12px;
  background: rgba(122, 169, 255, .08);
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.5;
}

.composer,
.comment-composer {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.composer label {
  display: block;
  color: var(--muted);
  font-size: .76rem;
}

.composer input,
.composer textarea,
.composer select,
.comment-composer textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 13px;
  color: var(--text);
  background: var(--solid);
  font-family: inherit;
  outline: 0;
  resize: vertical;
}

.composerRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.nick {
  padding: 6px 11px;
  border: 1px solid rgba(122, 169, 255, .35);
  border-radius: 999px;
  color: var(--blue);
  background: rgba(122, 169, 255, .14);
  font-size: .75rem;
  font-weight: 700;
}

.btn {
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: #fff;
  background: var(--blue2);
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
}

.rating-fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.rating-fieldset legend {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: .76rem;
}

.rating-buttons {
  display: flex;
  gap: 8px;
}

.rating-buttons button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  background: var(--solid);
  font-weight: 800;
  cursor: pointer;
  transition: .2s;
}

.rating-buttons button:hover,
.rating-buttons button.active {
  border-color: var(--blue);
  color: #fff;
  background: var(--blue2);
}

.comments-dialog {
  max-height: min(760px, 92vh);
  overflow-y: auto;
}

.commentlist {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.upload {
  position: fixed;
  z-index: 20;
  right: 22px;
  bottom: 22px;
  display: flex;
  align-items: center;
  width: 58px;
  height: 58px;
  overflow: hidden;
  border: 1px solid rgba(200, 220, 255, .40);
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, #4e7feb, #7a55c8);
  box-shadow: 0 12px 30px rgba(45, 72, 190, .45);
  cursor: pointer;
  transition: .35s;
}

.upload:hover {
  width: 250px;
  border-radius: 999px;
  transform: translateY(-4px);
}

.upload b {
  min-width: 57px;
  font-size: 1.7rem;
  font-weight: 400;
}

.upload span {
  white-space: nowrap;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .05em;
}

.modal {
  position: fixed;
  z-index: 60;
  display: grid;
  place-items: center;
  inset: 0;
  padding: 20px;
  background: rgba(6, 10, 18, .68);
  backdrop-filter: blur(8px);
}

.modal[hidden] {
  display: none;
}

.modal section {
  position: relative;
  width: min(560px, 100%);
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--solid);
  box-shadow: var(--shadow);
}

.modal h2 {
  margin: 12px 0;
  font-size: 1.9rem;
  letter-spacing: -.05em;
}

.modal p {
  color: var(--muted);
  line-height: 1.6;
}

.modal a {
  display: inline-block;
  margin-top: 10px;
  padding: 11px 16px;
  border-radius: 12px;
  color: #fff;
  background: var(--blue2);
  font-size: .8rem;
  font-weight: 800;
  text-decoration: none;
}

.close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text);
  background: transparent;
  font-size: 1.3rem;
  cursor: pointer;
}

.toast {
  position: fixed;
  z-index: 70;
  bottom: 25px;
  left: 50%;
  padding: 10px 15px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: #fff;
  background: #111927;
  font-size: .78rem;
  transform: translateX(-50%);
}

.toast[hidden] {
  display: none;
}

.cookie-banner {
  position: fixed;
  z-index: 80;
  left: 50%;
  bottom: 18px;
  width: min(640px, calc(100% - 28px));
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--solid);
  box-shadow: var(--shadow);
  transform: translateX(-50%);
}

.cookie-banner[hidden] {
  display: none;
}

.cookie-banner p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.5;
}

.cookie-buttons {
  display: flex;
  gap: 10px;
}

.cookie-buttons a,
.cookie-buttons button {
  flex: 1;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  background: transparent;
  font-size: .8rem;
  font-weight: 800;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: .2s;
}

.cookie-buttons a:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.cookie-buttons button {
  border-color: var(--blue2);
  color: #fff;
  background: var(--blue2);
}

.ad-slot[hidden] {
  display: none;
}

.ad-slot {
  max-width: 1100px;
  margin: 4.5rem auto 1.5rem;
  padding: 0 1.25rem;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--border, rgba(255,255,255,.14));
  border-radius: 12px;
  color: var(--muted);
  font-size: 0.8rem;
}

.ad-slot:empty::before {
  content: "Oglasni prostor";
  opacity: 0.5;
}

.ad-slot:not(:empty) {
  border: none;
  min-height: 0;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 2.25rem 1.25rem 1.5rem;
  font-size: 0.8rem;
  color: var(--muted);
  max-width: 1100px;
  margin: 0 auto;
}

.footer-left {
  opacity: 0.9;
}

.footer-right {
  text-align: right;
}

.footer-legal-link {
  font-size: 0.75rem;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}

.footer-legal-link:hover {
  color: var(--blue);
}

@media (max-width: 480px) {
  .site-footer {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .footer-right {
    text-align: center;
  }
}

.site-footer-simple {
  max-width: 1100px;
  margin: 3rem auto 1.5rem;
  padding: 1rem 1.25rem;
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.4;
  border-top: 1px solid var(--border);
}

.loader {
  position: fixed;
  z-index: 100;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  inset: 0;
  color: var(--muted);
  background: var(--deep);
  transition: .4s;
}

.loader.done {
  visibility: hidden;
  opacity: 0;
}

.loader p {
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.scales {
  position: relative;
  width: 116px;
  height: 88px;
  animation: float 1.8s ease-in-out infinite;
}

.pole {
  position: absolute;
  top: 7px;
  left: 56px;
  width: 5px;
  height: 57px;
  border-radius: 4px;
  background: var(--blue);
}

.base {
  position: absolute;
  bottom: 8px;
  left: 36px;
  width: 45px;
  height: 7px;
  border-radius: 8px 8px 2px 2px;
  background: var(--blue);
}

.beam {
  position: absolute;
  top: 22px;
  left: 12px;
  width: 92px;
  height: 4px;
  border-radius: 4px;
  background: var(--blue);
  transform-origin: center;
  animation: tilt 1.8s ease-in-out infinite;
}

.chain {
  position: absolute;
  top: 25px;
  width: 2px;
  height: 18px;
  background: var(--blue);
}

.chain-left {
  left: 18px;
  transform-origin: top;
  animation: chainL 1.8s ease-in-out infinite;
}

.chain-right {
  right: 18px;
  transform-origin: top;
  animation: chainR 1.8s ease-in-out infinite;
}

.pan {
  position: absolute;
  top: 43px;
  width: 31px;
  height: 16px;
  border: 3px solid var(--blue);
  border-top: 0;
  border-radius: 0 0 20px 20px;
}

.pan-l {
  left: 3px;
  animation: panL 1.8s ease-in-out infinite;
}

.pan-r {
  right: 3px;
  animation: panR 1.8s ease-in-out infinite;
}

@keyframes float {
  50% {
    transform: translateY(-5px);
  }
}

@keyframes tilt {
  0%, 100% {
    transform: rotate(-4deg);
  }

  50% {
    transform: rotate(4deg);
  }
}

@keyframes chainL {
  0%, 100% {
    transform: rotate(-4deg);
  }

  50% {
    transform: rotate(4deg);
  }
}

@keyframes chainR {
  0%, 100% {
    transform: rotate(-4deg);
  }

  50% {
    transform: rotate(4deg);
  }
}

@keyframes panL {
  0%, 100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(7px);
  }
}

@keyframes panR {
  0%, 100% {
    transform: translateY(7px);
  }

  50% {
    transform: translateY(0);
  }
}

.reveal {
  opacity: 0;
  transform: translateX(-22px);
  transition: .6s cubic-bezier(.2, .8, .2, 1);
}

.reveal.show {
  opacity: 1;
  transform: none;
}

@media (max-width: 1100px) {
  .terms-page-body .roman-columns {
    display: none;
  }
}

@media (max-width: 700px) {
  .hero-header {
    width: calc(100% - 20px);
    height: 70px;
    margin-top: 8px;
  }

  .home-page .hero-header {
    height: 90px;
  }

  .back {
    display: none;
  }

  .home,
  .page,
  .subjectpage,
  .site-footer {
    width: calc(100% - 20px);
  }

  .home-page .home {
    width: calc(100% - 20px);
  }

  .hero {
    margin: 28px auto 36px;
    text-align: center;
  }

  .hero small,
  .hero .materials-count {
    text-align: center;
  }

  .hero h1 {
    font-size: 2.7rem;
    text-align: center;
  }

  .tile {
    padding: 24px;
  }

  .home-page .tile.year-tile {
    min-height: 108px;
  }

  .home-page .years-stack {
    width: calc(100% - 6px);
    margin: 0 auto;
  }

  .material {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    column-gap: 10px;
    row-gap: 10px;
  }

  .material > div:first-child {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }

  .material > div:first-child h3,
  .material > div:first-child p {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Break the actions wrapper apart so its children become direct grid
     items of .material, without touching the HTML/JS that builds them. */
  .material .material-actions {
    display: contents;
  }

  .material .material-actions .votes {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  .material .material-actions .comment-button {
    grid-column: 1;
    grid-row: 2;
    justify-self: start;
  }

  .material .material-actions a[data-script-download] {
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
    text-align: center;
  }

  .experience-actions {
    width: 100%;
    justify-content: center;
  }

  .experience-invite {
    align-items: flex-start;
    padding: 23px;
  }

  .experience-invite > span {
    font-size: 1.6rem;
  }

  .rating-buttons button {
    width: 38px;
    height: 38px;
  }

  .upload {
    right: 14px;
    bottom: 15px;
  }

  .upload:hover {
    width: 58px;
    border-radius: 50%;
    transform: none;
  }

  .upload span {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

body.light.home-page .years-stack .year-tile,
body.light.home-page .years-stack .year-tile h2,
body.light.home-page .years-stack .year-tile span {
  color: #ffffff;
  text-shadow: 0 2px 14px rgba(0, 0, 0, .82);
}

.page-spacer {
  height: 90px;
}

@media (max-width: 720px) {
  .page-spacer {
    height: 70px;
  }
}

.tabs.tabs-fluid {
  position: relative;
}

.tabs .tab-indicator {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  border-radius: 12px;
  background: var(--blue2);
  z-index: 0;
  pointer-events: none;
  will-change: transform, width;
}

.tabs.tabs-fluid button {
  position: relative;
  z-index: 1;
  background: transparent;
  border-color: transparent;
}

.tabs.tabs-fluid button.active {
  color: #fff;
}

@keyframes liquidFlow {
  0% {
    transform: translateX(var(--from-x, 0px)) scaleX(1);
  }
  45% {
    transform: translateX(calc((var(--from-x, 0px) + var(--to-x, 0px)) / 2)) scaleX(1.22);
  }
  100% {
    transform: translateX(var(--to-x, 0px)) scaleX(1);
  }
}
