:root {
  color-scheme: light;
  --ink: #28351f;
  --soft: #5d6654;
  --paper: rgba(255, 252, 245, .84);
  --line: rgba(65, 77, 45, .18);
  font-family: "Mulish", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(255, 251, 243, .2), rgba(255, 251, 243, .3)),
    url("assets/pastel-watercolour-quiz-bg-v2.png") top center / cover fixed no-repeat,
    #f7f0e5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  transform: translateY(-160%);
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
}

.skip-link:focus { transform: none; }

.library-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 12px clamp(18px, 4vw, 64px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 251, 243, .55);
  backdrop-filter: blur(13px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(58, 71, 37, .42);
  border-radius: 48% 52% 46% 54% / 52% 45% 55% 48%;
  background: rgba(255, 252, 244, .62);
  font: 600 17px/1 "Cormorant Garamond", serif;
}

.brand-name { font: 600 24px/1 "Cormorant Garamond", serif; }
.brand-name small { display: block; margin-top: 6px; color: var(--soft); font: 600 8px/1 "Mulish", sans-serif; letter-spacing: .17em; text-transform: uppercase; }

.header-links { display: flex; align-items: center; gap: 10px; }
.header-links a { font-size: 12px; font-weight: 700; text-decoration: none; }
.header-links a:last-child { padding: 10px 16px; background: transparent url("assets/button-sage-v1.png") center / 100% 100% no-repeat; }

.library-main { width: min(1180px, calc(100% - 36px)); margin: 0 auto; padding: clamp(38px, 6vw, 80px) 0 60px; }

.library-intro { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr); align-items: center; gap: clamp(30px, 6vw, 90px); }
.eyebrow { margin: 0 0 12px; color: #66704f; font-size: 10px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; }
.library-intro h1 { max-width: 800px; margin: 0; font: 600 clamp(48px, 6vw, 82px)/.9 "Cormorant Garamond", serif; letter-spacing: -.035em; text-wrap: balance; }
.intro-copy { max-width: 760px; margin: 22px 0 10px; color: #4f5948; font-size: clamp(15px, 1.5vw, 18px); line-height: 1.58; }
.boundary { margin: 0; color: #69705f; font-size: 12px; line-height: 1.55; }

.intro-note {
  padding: 50px 45px 58px;
  background: transparent url("assets/watercolour-reassurance-note-v2.png") center / 100% 100% no-repeat;
  filter: drop-shadow(0 20px 30px rgba(66, 71, 45, .09));
  font: italic 500 27px/1.05 "Cormorant Garamond", serif;
  text-align: center;
}

.quiz-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 17px; margin-top: clamp(36px, 5vw, 62px); }

.quiz-card {
  position: relative;
  display: flex;
  min-height: 190px;
  flex-direction: column;
  justify-content: space-between;
  padding: 28px 25px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 31px 43px 29px 38px / 39px 31px 44px 34px;
  background: rgba(255, 251, 243, .72);
  box-shadow: 0 17px 38px rgba(70, 70, 47, .08);
  text-decoration: none;
  backdrop-filter: blur(8px);
  transition: transform .2s ease, box-shadow .2s ease;
}

.quiz-card:nth-child(3n + 1) { background: rgba(231, 239, 220, .74); }
.quiz-card:nth-child(3n + 2) { background: rgba(237, 227, 243, .74); }
.quiz-card:nth-child(3n) { background: rgba(247, 224, 216, .74); }
.quiz-card:hover { transform: translateY(-4px); box-shadow: 0 22px 45px rgba(70, 70, 47, .12); }
.quiz-card .short { color: #7a805f; font-size: 10px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.quiz-card h2 { margin: 16px 0 10px; font: 600 27px/1 "Cormorant Garamond", serif; }
.quiz-card p { margin: 0; color: #596252; font-size: 11px; line-height: 1.5; }
.quiz-card .go { align-self: flex-end; margin-top: 16px; color: #3e4d2b; font-size: 11px; font-weight: 800; }

.general-card { grid-column: span 2; min-height: 150px; background: rgba(255, 251, 243, .78); }

.search-copy { margin-top: 55px; padding: 30px clamp(24px, 4vw, 48px); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(255, 252, 246, .58); }
.search-copy h2 { margin: 0 0 10px; font: 600 34px/1 "Cormorant Garamond", serif; }
.search-copy p { max-width: 900px; margin: 0; color: #596252; font-size: 13px; line-height: 1.65; }
.search-copy p + p { margin-top: 20px; }

.query-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 20px 0;
}

.query-links a {
  padding: 13px 15px;
  border: 1px solid rgba(65, 77, 45, .14);
  border-radius: 18px 24px 17px 21px / 22px 17px 24px 18px;
  background: rgba(255, 252, 245, .66);
  color: #3f4d35;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  text-decoration: none;
}

.library-footer { display: flex; justify-content: space-between; gap: 20px; padding: 16px clamp(18px, 4vw, 64px); border-top: 1px solid var(--line); background: rgba(255, 251, 243, .62); color: #5b6253; }
.library-footer p { margin: 0; font-size: 10px; }

a:focus-visible { outline: 3px solid rgba(90, 108, 56, .38); outline-offset: 4px; }

@media (max-width: 960px) {
  .quiz-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .library-header { min-height: 60px; padding-inline: 16px; }
  .brand-mark { width: 32px; height: 32px; }
  .brand-name { font-size: 19px; }
  .brand-name small { display: none; }
  .header-links a:first-child { display: none; }
  .library-main { width: calc(100% - 28px); padding-top: 36px; }
  .library-intro { grid-template-columns: 1fr; }
  .library-intro h1 { font-size: clamp(44px, 14vw, 64px); }
  .intro-note { display: none; }
  .quiz-grid { grid-template-columns: 1fr; }
  .general-card { grid-column: auto; }
  .query-links { grid-template-columns: 1fr; }
  .library-footer { display: block; }
  .library-footer p + p { margin-top: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .01ms !important; }
}
