/* Clearbox site. Tokens come from brand/identity/IDENTITY.md: no shadows, gradients or outlines; radius 24px. */
@font-face { font-family: 'Fredoka'; src: url('assets/fonts/fredoka.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Figtree'; src: url('assets/fonts/figtree.woff2') format('woff2'); font-weight: 400 700; font-display: swap; }

:root {
  --blue: #37597A;
  --snow: #FFFFFF;
  --muzzle: #F7A85A;
  --ember: #D8672F;
  --midnight: #14213D;
  --frost: #D9E1EC;
  --ink: #0F1830;
  --display: 'Fredoka', system-ui, sans-serif;
  --body: 'Figtree', system-ui, sans-serif;
  --radius: 24px;
  --gutter: clamp(20px, 5vw, 64px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { font-family: var(--body); font-size: 18px; line-height: 1.55; color: var(--ink); background: var(--snow); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2 { font-family: var(--display); font-weight: 600; letter-spacing: -0.015em; line-height: 1.04; }
h2 { font-size: clamp(38px, 5.4vw, 68px); color: var(--blue); }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter); }

:focus-visible { outline: 3px solid var(--ember); outline-offset: 3px; border-radius: 6px; }

.button {
  display: inline-block; padding: 14px 26px; border-radius: 999px;
  background: var(--muzzle); color: var(--ink); font-weight: 600; text-decoration: none;
  transition: background-color .15s ease;
}
.button:hover { background: var(--snow); }

/* Hero: the master logo's field is exactly the page blue, so the bear rises straight out of the page. */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh; overflow: hidden;
  background: var(--blue); color: var(--snow);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto 1fr;
}
.wordmark {
  grid-column: 1 / -1; position: relative; z-index: 2;
  font-size: min(calc((100vw - 2 * var(--gutter)) / 3.8), 44vh); line-height: .86; letter-spacing: -0.02em;
  padding: clamp(18px, 3vw, 40px) var(--gutter) 0;
}
.hero-copy {
  grid-column: 2; grid-row: 2; position: relative; z-index: 2; align-self: center;
  padding: 24px var(--gutter) 48px 0; max-width: 560px;
}
.tagline { font-family: var(--display); font-weight: 600; font-size: clamp(32px, 3.6vw, 50px); line-height: 1.08; letter-spacing: -0.01em; }
.lede { margin-top: 16px; font-size: clamp(18px, 1.6vw, 21px); color: var(--frost); max-width: 34em; }
.hero-links { margin-top: 28px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.plain { font-weight: 600; text-underline-offset: 4px; }
.plain:hover { color: var(--muzzle); }
.hero .button:hover { background: var(--snow); }
.bear {
  position: absolute; left: 0; bottom: 0; z-index: 1;
  width: min(50vw, calc(100vh - 21vw)); height: auto;
}

/* The boxes: the one memorable thing on the page. A dark lid over a clear inside. */
.boxes { padding: clamp(64px, 9vw, 120px) 0; }
.sub { margin-top: 10px; font-size: clamp(20px, 2vw, 24px); color: var(--ink); }
.box-grid { margin-top: clamp(32px, 4vw, 52px); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.box {
  position: relative; display: grid; min-height: 340px; overflow: hidden;
  border-radius: var(--radius); background: var(--frost);
}
.box > * { grid-area: 1 / 1; min-width: 0; }
.lid {
  --x: 50%; --y: 50%;
  position: relative; z-index: 1; width: 100%; border: 0; cursor: pointer; text-align: left;
  display: flex; flex-direction: column; justify-content: space-between; gap: 24px; padding: 26px;
  background: var(--midnight); color: var(--snow); font: inherit;
  clip-path: circle(150% at var(--x) var(--y));
  transition: clip-path .6s cubic-bezier(.5, 0, .2, 1), background-color .15s ease, visibility 0s;
}
.lid:hover { background: var(--blue); }
.lid:focus-visible { outline-offset: -6px; border-radius: var(--radius); }
.question { font-family: var(--display); font-weight: 600; font-size: 29px; line-height: 1.12; }
.hint { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; color: var(--frost); }
.hint::before { content: ''; width: 16px; height: 16px; border-radius: 50%; background: var(--muzzle); }
.box.open .lid {
  clip-path: circle(0% at var(--x) var(--y)); visibility: hidden;
  transition: clip-path .6s cubic-bezier(.5, 0, .2, 1), visibility 0s linear .6s;
}
.inside { visibility: hidden; padding: 26px; display: flex; flex-direction: column; gap: 12px; }
.box.open .inside { visibility: visible; }
.inside-q { font-family: var(--display); font-weight: 600; font-size: 20px; line-height: 1.15; color: var(--blue); }
.inside p { font-size: 17px; line-height: 1.45; }
.inside p.inside-q { font-size: 20px; line-height: 1.15; }
.inside-foot { margin-top: auto; padding-top: 6px; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.inside p.inside-foot { font-size: 15px; font-weight: 600; }
.inside-foot a { text-underline-offset: 3px; }
.close { border: 0; background: none; font: inherit; color: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* Latest video */
.latest { background: var(--midnight); color: var(--snow); padding: clamp(64px, 9vw, 120px) 0; }
.latest-grid { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: clamp(32px, 7vw, 96px); align-items: center; }
.latest h2 { color: var(--snow); }
.latest p { max-width: 32em; }
.latest-grid > div > * + * { margin-top: 18px; }
.latest-label { font-weight: 600; color: var(--muzzle); }
.poster { position: relative; display: block; border-radius: var(--radius); overflow: hidden; }
.play {
  position: absolute; left: 50%; top: 50%; width: 84px; height: 84px; margin: -42px 0 0 -42px;
  border-radius: 50%; background: var(--muzzle); transition: transform .15s ease;
}
.play::after {
  content: ''; position: absolute; left: 33px; top: 26px; width: 0; height: 0;
  border-left: 26px solid var(--ink); border-top: 16px solid transparent; border-bottom: 16px solid transparent;
}
.poster:hover .play { transform: scale(1.08); }

/* About */
.about { background: var(--frost); padding: clamp(64px, 8vw, 104px) 0; }
.about-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px); gap: clamp(24px, 6vw, 80px); align-items: center; }
.about p { margin-top: 18px; max-width: 34em; font-size: clamp(18px, 1.7vw, 21px); }

/* Footer */
.foot { background: var(--blue); color: var(--snow); padding: 52px 0 36px; }
.foot-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px 40px; align-items: end; }
.foot-mark { font-family: var(--display); font-weight: 600; font-size: 44px; letter-spacing: -0.02em; line-height: 1; }
.foot-mark + p { margin-top: 8px; color: var(--frost); }
.foot ul { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 24px; font-weight: 600; }
.foot ul a { text-underline-offset: 4px; }
.foot ul a:hover { color: var(--muzzle); }
.fine { grid-column: 1 / -1; font-size: 15px; color: var(--frost); }

/* 404 */
.lost { min-height: 100vh; min-height: 100svh; background: var(--blue); color: var(--snow); display: grid; place-content: center; justify-items: start; gap: 18px; padding: var(--gutter); }
.lost h1 { font-size: clamp(48px, 8vw, 96px); }

@media (max-width: 1080px) {
  .box-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .box { min-height: 290px; }
}

@media (max-width: 760px) {
  .hero { display: flex; flex-direction: column; }
  .wordmark { padding-top: 24px; }
  .hero-copy { padding: 20px var(--gutter) 8px; max-width: none; align-self: stretch; }
  .bear { position: relative; left: 0; bottom: auto; width: 86vw; max-width: 460px; margin-top: auto; }
  .latest-grid { grid-template-columns: minmax(0, 1fr); }
  .poster { max-width: 300px; }
  .about-grid { grid-template-columns: minmax(0, 1fr); }
  .about-grid img { width: 190px; }
  .foot-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 620px) {
  .hero-links .button { flex: 0 0 100%; text-align: center; }
  .box-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .box { min-height: 230px; }
  .question { font-size: 27px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .lid, .box.open .lid { transition: none; }
}
