/* The sticky bar, the first screen and the "Start here" cards that preview every section. */

/* Sticky top bar */
.nav {
  position: sticky; top: 0; z-index: 40;
  height: var(--nav-h);
  background: rgba(18, 18, 20, .82);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease);
}
.nav.is-stuck { border-bottom-color: var(--line); }
.nav-in { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.wordmark { font-family: var(--font-display); font-size: 1.5rem; letter-spacing: -0.01em; text-decoration: none; line-height: 1; }
.nav-links { display: flex; align-items: center; gap: clamp(20px, 2.6vw, 36px); }
.nav-links a[data-nav] { position: relative; padding: 8px 0; text-decoration: none; color: var(--soft); transition: color .2s var(--ease); }
.nav-links a[data-nav]:hover, .nav-links a[data-nav][aria-current="true"] { color: var(--ink); }
.nav-links a[data-nav]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 2px;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform .3s var(--ease);
}
.nav-links a[data-nav][aria-current="true"]::after { transform: scaleX(1); }
.menu-btn { display: none; width: 44px; height: 44px; border-radius: 50%; place-items: center; font-size: 22px; background: var(--surface-2); }
.menu-btn .ico-x { display: none; }
.menu-btn[aria-expanded="true"] .ico-menu { display: none; }
.menu-btn[aria-expanded="true"] .ico-x { display: block; }

@media (max-width: 720px) {
  .menu-btn { display: grid; }
  .nav-links {
    position: absolute; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px var(--margin) 20px;
    background: var(--bg); border-bottom: 1px solid var(--line);
    box-shadow: 0 24px 40px rgba(0, 0, 0, .45);
  }
  .js .nav-links:not(.is-open) { display: none; }
  .nav-links a[data-nav] { padding: 14px 0; font-size: var(--step-lead); color: var(--ink); border-bottom: 1px solid var(--line); }
  .nav-links a[data-nav]::after { display: none; }
  .nav-cta { margin-top: 16px; min-height: 50px; font-size: var(--step-body); }
}

/* First screen: name, one sentence, the live age and two actions; the photo with the game beside it. */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  align-items: center;
  gap: clamp(32px, 6vw, 112px);
  padding-top: clamp(28px, 3.5vw, 48px);
  padding-bottom: clamp(32px, 3.5vw, 48px);
}
.hero-text { display: grid; justify-items: start; gap: clamp(20px, 2.4vw, 28px); }
.name { font-size: var(--step-name); line-height: .88; letter-spacing: -0.035em; }
.hero-lede strong { font-weight: 500; color: var(--ink); }
/* Organisation links in the intro: ink by default, each in its own colour on hover. */
.org-link {
  font-weight: 500; color: var(--ink);
  text-decoration: underline; text-decoration-color: rgba(237, 236, 239, .35); text-underline-offset: .22em;
  transition: color .2s var(--ease), text-decoration-color .2s var(--ease);
}
.org-link--raikes { --org: #e8303a; } /* Nebraska scarlet, lifted for the dark ground */
.org-link--hudl { --org: #ff6a13; }   /* Hudl orange */
.org-link:hover, .org-link:focus-visible { color: var(--org); text-decoration-color: var(--org); }
.org-link:focus-visible { outline-color: var(--org); }
.hero-lede { max-width: 36em; font-size: var(--step-lead); line-height: 1.4; color: var(--soft); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.age { display: grid; gap: 4px; }
.age-num { font-family: var(--font-display); font-size: var(--step-title); line-height: 1; letter-spacing: -0.01em; white-space: nowrap; }
.age-num .d { display: inline-block; width: 0.56em; text-align: center; }
.age-num .p { display: inline-block; width: 0.26em; text-align: center; }
.age-unit { color: var(--soft); font-size: var(--step-small); }

.hero-photo { position: relative; display: grid; justify-items: center; }
.portrait { position: relative; z-index: 2; width: 100%; } /* above the caption, so the whole badge clicks */
.portrait-frame { aspect-ratio: 4 / 5; border-radius: var(--radius); background: var(--surface-2); }
.portrait-frame .pfx { object-position: 50% 28%; }

/* The tiny game button sits on the photo's bottom edge. */
.rps-badge {
  position: absolute; left: 50%; bottom: 0;
  width: 60px; height: 60px; margin: 0 0 -30px -30px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--accent); color: var(--on-accent);
  font-size: 30px;
  box-shadow: 0 0 0 6px var(--bg);
  transition: transform .3s var(--ease), background-color .3s var(--ease);
}
.rps-badge .ico { width: 1em; height: 1em; }
.rps-badge:hover { background: var(--accent-hover); transform: rotate(-12deg) scale(1.06); }
.rps-badge[aria-expanded="true"] { background: var(--ink); color: var(--bg); }
.rps-badge:focus-visible { outline-offset: 8px; }
@media (prefers-reduced-motion: no-preference) {
  .rps-badge.is-nudging { animation: nudge 1.4s var(--ease) 2; }
}
@keyframes nudge {
  0%, 60%, 100% { transform: rotate(0); }
  15% { transform: rotate(-16deg) translateY(-3px); }
  30% { transform: rotate(10deg); }
  45% { transform: rotate(-6deg); }
}

.rps-dock { position: relative; width: 100%; padding-top: 42px; text-align: center; font-size: var(--step-small); line-height: 1.45; }
.rps-rate { display: grid; justify-items: center; gap: 2px; }
.rate-line { font-size: var(--step-body); font-weight: 500; }
.rate-num { font-weight: 500; font-variant-numeric: tabular-nums; color: var(--accent); }
.rate-def { max-width: 30ch; color: var(--soft); }

@media (max-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr); padding-top: 32px; gap: 32px; }
  /* Phones: a small photo with the game beside it, so the Start here cards come up sooner. */
  .hero-photo {
    grid-template-columns: minmax(0, 168px) minmax(0, 1fr); align-items: center; gap: 24px;
    justify-items: stretch; width: 100%;
  }
  .rps-dock { padding-top: 0; text-align: left; }
  .rps-rate { justify-items: start; }
  .rate-def { max-width: none; }
  .rps-badge { left: auto; right: -12px; bottom: -12px; margin: 0; width: 56px; height: 56px; font-size: 28px; }
}
@media (max-width: 520px) {
  .hero-actions { width: 100%; }
  .hero-actions .btn { flex: 1 1 0; }
  .age-num { font-size: 2rem; }
}

/* Start here: one card per section. Every card is a single link, so its picture, text and padding all click. */
.start { padding-bottom: var(--section-gap); }
.start .sec-head { margin-bottom: 20px; }
.start .sec-title { font-size: var(--step-title); }
.bento {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: minmax(200px, auto);
  gap: clamp(12px, 1.6vw, 20px);
}
.tz {
  position: relative;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 16px;
  min-height: 200px;
  padding: clamp(20px, 2.2vw, 28px);
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  overflow: hidden;
  isolation: isolate;
  transition: background-color .25s var(--ease), border-color .25s var(--ease);
}
.tz:hover { background: var(--surface-2); border-color: rgba(255, 255, 255, .14); }
.tz-body { display: grid; gap: 6px; max-width: 30em; padding-right: 56px; }
.tz-title { font-family: var(--font-display); font-weight: 400; font-size: var(--step-title); line-height: 1; letter-spacing: -0.02em; }
.tz-text { color: var(--soft); }
.tz-go {
  position: absolute; right: clamp(16px, 2vw, 24px); bottom: clamp(16px, 2vw, 24px);
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-3); color: var(--ink); font-size: 18px;
  transition: background-color .25s var(--ease), color .25s var(--ease), transform .3s var(--ease);
}
.tz:hover .tz-go { background: var(--accent); color: var(--on-accent); transform: rotate(-45deg); }

.tz-media { display: block; border-radius: 14px; background: var(--surface-2); flex: 1 1 auto; min-height: 140px; }
.tz--loopback { grid-column: span 6; grid-row: span 2; }
.tz--loopback .tz-media { min-height: 260px; }
.tz--pitchy { grid-column: span 3; grid-row: span 2; }
.tz--pitchy .tz-media .pfx { object-position: 0 0; }
.tz--recall { grid-column: span 3; grid-row: span 2; }
.tz--exp { grid-column: span 3; }
.tz--ftc { grid-column: span 6; background: var(--paper); color: var(--paper-ink); border-color: transparent; justify-content: space-between; }
.tz--ftc:hover { background: var(--paper-2); border-color: transparent; }
.tz--ftc .tz-text { color: var(--paper-soft); }
.tz--ftc .tz-go { background: var(--paper-2); color: var(--paper-ink); }
.tz--ftc:focus-visible { outline-color: var(--paper-accent); }
.tz--links { grid-column: span 3; }

.tz-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding-right: 56px; }
.tz-stat { display: grid; gap: 6px; align-content: start; }
.tz-stat b { font-family: var(--font-display); font-weight: 400; font-size: clamp(2.5rem, 1.6rem + 3vw, 4rem); line-height: .9; letter-spacing: -0.03em; }
.tz-stat span { color: var(--paper-soft); font-size: var(--step-small); line-height: 1.35; }

/* Recall's cover: its app icon in front of a fan of flashcards in Recall's colours; the fan opens on hover. */
.recall-cover {
  position: relative; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 40%, #232a63 0%, #121634 70%);
}
.rc-card {
  position: absolute; width: 46%; aspect-ratio: 3 / 2; border-radius: 10px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .35);
  transition: transform .45s var(--ease-out);
}
.rc-card::before, .rc-card::after { content: ""; position: absolute; left: 12%; height: 7%; border-radius: 99px; background: currentColor; opacity: .35; }
.rc-card::before { top: 22%; width: 62%; }
.rc-card::after { top: 38%; width: 44%; }
.rc-card--1 { background: #d9f2e6; color: #0f7a50; transform: translate(-46%, -22%) rotate(-16deg); }
.rc-card--2 { background: #fbe9c9; color: #9a610a; transform: translate(46%, -26%) rotate(14deg); }
.rc-card--3 { background: #e4e3fb; color: #4a4ac4; transform: translate(0, 34%) rotate(-4deg); }
.rc-icon {
  position: relative; z-index: 1; width: 40%; max-width: 132px; height: auto;
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, .5));
  transition: transform .45s var(--ease-out);
}
.tz--recall:hover .rc-card--1 { transform: translate(-62%, -30%) rotate(-24deg); }
.tz--recall:hover .rc-card--2 { transform: translate(62%, -34%) rotate(22deg); }
.tz--recall:hover .rc-card--3 { transform: translate(0, 46%) rotate(-2deg); }
.tz--recall:hover .rc-icon { transform: scale(1.06) rotate(-4deg); }

.tz-rate { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: auto; }
.tz-rate span { padding: 8px 14px; border-radius: 999px; background: var(--surface-3); font-size: var(--step-small); font-weight: 500; }
.tz-rate .is-good { background: var(--accent); color: var(--on-accent); }

.tz-icons { display: flex; gap: 10px; margin-bottom: auto; }
.tz-icons span {
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-3); font-size: 28px;
  transition: transform .35s var(--ease), background-color .25s var(--ease);
}
.tz-icons .ico { width: 26px; height: 26px; fill: none; }

@media (max-width: 960px) {
  .tz--loopback, .tz--pitchy { grid-column: span 6; grid-row: span 1; }
  .tz--recall, .tz--exp { grid-column: span 6; grid-row: span 1; }
  .tz--ftc, .tz--links { grid-column: span 12; }
}
@media (max-width: 640px) {
  .bento { grid-template-columns: minmax(0, 1fr); grid-auto-rows: auto; }
  .tz, .tz--loopback, .tz--pitchy, .tz--recall, .tz--exp, .tz--ftc, .tz--links { grid-column: 1 / -1; grid-row: auto; min-height: 0; }
  .tz-media, .tz--loopback .tz-media { min-height: 0; aspect-ratio: 16 / 9; flex: none; }
  .tz-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); padding-right: 0; gap: 12px; }
  .tz--ftc .tz-body { padding-right: 56px; }
  .tz-icons span { width: 48px; height: 48px; font-size: 24px; }
}
