/* canardev.com
   colours: warm black + duck yellow + bill orange. no blue/purple on purpose. */

:root {
  --bg: #11100e;
  --bg-2: #181713;
  --card: #1c1a16;
  --card-2: #23211c;
  --line: #302d26;
  --line-2: #433f35;
  --ink: #f4eee3;
  --muted: #b0a899; /* 8.6:1 on --bg */
  --dim: #8f8778; /* 5.2:1 on --bg, still passes for small text */
  --duck: #ffc531;
  --duck-deep: #e9a90c;
  --bill: #ff7a1a;
  --live: #ff5536;

  --display: "Bricolage Grotesque", "Trebuchet MS", system-ui, sans-serif;
  --mono: "DM Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --radius: 16px;
  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
}

@media (min-width: 1800px) {
  :root {
    --wrap: 1320px;
  }
}

/* big monitors (1440p, 4K): scale the whole page up so it doesn't look tiny */
@media (min-width: 2200px) {
  html {
    zoom: 1.3;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  overflow-x: clip;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 300px;
  background-color: var(--bg);
  /* the stud grid: little dots like a roblox baseplate */
  background-image: radial-gradient(circle, rgba(244, 238, 227, 0.05) 1.5px, transparent 2px);
  background-size: 24px 24px;
  color: var(--ink);
  font-family: var(--display);
  font-size: 17px;
  line-height: 1.55;
  overflow-x: clip;
  -webkit-tap-highlight-color: transparent;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

::selection {
  background: var(--duck);
  color: #111;
}

:focus-visible {
  outline: 3px solid var(--duck);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
}

/* for screen readers only */
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--duck);
  color: #111;
  font-weight: 700;
  text-decoration: none;
}

.skip:focus {
  top: 12px;
}

/* ---------- nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  min-height: 44px;
  gap: 10px;
  text-decoration: none;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.03em;
}

.brand img {
  width: 36px;
  height: 36px;
}

.nav-links {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 15px;
}

.nav-links a:hover {
  color: var(--ink);
  background: var(--card-2);
}

.nav-links .nav-cta {
  color: #111;
  background: var(--duck);
}

.nav-links .nav-cta:hover {
  color: #111;
  background: var(--ink);
}

@media (max-width: 680px) {
  .nav-links li:not(:last-child) {
    display: none;
  }
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  font: 700 16px/1 var(--display);
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn:active {
  transform: translateY(1px);
}

.btn-duck {
  background: var(--duck);
  border-color: var(--duck);
  color: #111;
}

.btn-sm {
  min-height: 44px;
  padding: 0 16px;
  font-size: 15px;
  border-radius: 10px;
}

/* only on devices with a real mouse, so taps don't leave things stuck lifted */
@media (hover: hover) {
  .btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 4px 4px 0 var(--ink);
  }
  .btn-duck:hover {
    box-shadow: 4px 4px 0 var(--bill);
  }
}

/* ---------- live dot ---------- */

.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 0 3px rgba(255, 85, 54, 0.22);
  flex: none;
}

.dot.off {
  background: var(--dim);
  box-shadow: none;
}

.changed {
  animation: changed 1.2s ease-out;
}

@keyframes changed {
  0% {
    color: var(--bill);
  }
}

/* ---------- hero ---------- */

.hero {
  padding: clamp(40px, 8vw, 104px) 0 clamp(16px, 4vw, 40px);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.9fr);
  gap: clamp(32px, 6vw, 72px);
  align-items: center;
}

.hero h1 {
  margin: 0;
  font-size: clamp(44px, 8vw, 104px);
  line-height: 0.95;
  letter-spacing: -0.045em;
  font-weight: 800;
}

.hero-lede {
  max-width: 30ch;
  margin: 22px 0 18px;
  font-size: clamp(19px, 2.2vw, 24px);
  line-height: 1.4;
  color: var(--muted);
}

.hero-live {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 32px;
  font-size: 17px;
  color: var(--muted);
}

.hero-live .dot {
  transform: translateY(-1px);
}

.hero-live b {
  color: var(--ink);
  font-family: var(--mono);
  font-weight: 500;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* the avatar sits on a yellow 'brick' with studs */
.avatar-card {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1.08;
  max-width: 440px;
  width: 100%;
  margin-left: auto;
  border-radius: 28px;
  background-color: var(--duck);
  background-image: radial-gradient(circle, var(--duck-deep) 9px, transparent 10px);
  background-size: 48px 48px;
  background-position: 24px 24px;
  box-shadow: 10px 10px 0 var(--bill);
  transform: rotate(2deg);
  text-decoration: none;
  transition: transform 0.4s cubic-bezier(0.3, 1.5, 0.5, 1);
}

@media (hover: hover) {
  .avatar-card:hover {
    transform: rotate(0deg) translateY(-4px);
  }
}

.avatar-card .avatar {
  position: absolute;
  top: 4%;
  left: 4%;
  width: 92%;
  height: 80%;
  object-fit: contain;
  filter: drop-shadow(0 14px 0 rgba(0, 0, 0, 0.16));
}

.name-tag {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 14px;
  background: #111;
  color: var(--ink);
}

.name-tag .who {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}

.name-tag .who strong {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 19px;
}

.name-tag .who > span {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
}

.verified {
  width: 17px;
  height: 17px;
  flex: none;
}

.name-tag .followers {
  text-align: right;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.2;
}

.name-tag .followers b {
  display: block;
  color: var(--duck);
  font-size: 17px;
  font-weight: 500;
}

@media (max-width: 880px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .avatar-card {
    max-width: 340px;
    margin: 8px auto 12px;
  }
}

@media (max-width: 380px) {
  .avatar-card {
    box-shadow: 6px 6px 0 var(--bill);
  }
  .name-tag {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }
}

/* ---------- sections ---------- */

section {
  scroll-margin-top: 80px;
}

.section {
  padding: clamp(64px, 9vw, 120px) 0 0;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-bottom: 28px;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(34px, 5.4vw, 60px);
  line-height: 1;
  letter-spacing: -0.04em;
  font-weight: 800;
}

.section-head .h2-sm {
  font-size: clamp(26px, 3.4vw, 36px);
}

.section-head p {
  margin: 0;
  max-width: 42ch;
  color: var(--muted);
}

.updated {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
}

/* ---------- stats ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin: 0;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
  overflow: hidden;
}

.stat {
  padding: 24px;
  border-right: 2px solid var(--line);
  border-bottom: 2px solid var(--line);
  min-width: 0;
}

.stat.big {
  grid-column: span 3;
  padding: 30px 28px 28px;
}

.stat:not(.big) {
  grid-column: span 2;
}

.stat:nth-child(2),
.stat:nth-child(5) {
  border-right: 0;
}

.stat:nth-child(n + 3) {
  border-bottom: 0;
}

.stat dt {
  margin: 0 0 10px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat dd {
  margin: 0;
  font-family: var(--mono);
  font-weight: 500;
  font-size: clamp(26px, 3.6vw, 44px);
  line-height: 1.05;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.stat.big dd {
  font-size: clamp(34px, 6vw, 76px);
  color: var(--duck);
}

.stat-note {
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.4;
  color: var(--dim);
}

.stats-foot {
  margin: 12px 2px 0;
  font-size: 14px;
  color: var(--dim);
}

@media (max-width: 820px) {
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stat,
  .stat.big,
  .stat:not(.big) {
    grid-column: span 1;
    padding: 20px 18px;
    border-right: 2px solid var(--line);
    border-bottom: 2px solid var(--line);
  }
  .stat.big:first-child {
    grid-column: span 2;
    border-right: 0;
  }
  .stat:nth-child(3),
  .stat:nth-child(5) {
    border-right: 0;
  }
  .stat:nth-child(n + 4) {
    border-bottom: 0;
  }
}

/* ---------- games ---------- */

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

.game {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}

@media (hover: hover) {
  .game:hover {
    transform: translate(-4px, -4px);
    border-color: var(--duck);
    box-shadow: 8px 8px 0 var(--duck);
  }
}

.game-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--card-2);
  overflow: hidden;
}

.game-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chip {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 24px);
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(17, 16, 14, 0.9);
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink);
  white-space: nowrap;
}

.tag {
  position: absolute;
  bottom: 12px;
  right: 12px;
  padding: 5px 10px;
  border-radius: 8px;
  background: var(--duck);
  color: #111;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tag.sold {
  background: var(--ink);
}

.game-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 0 20px 20px;
}

.game-title {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.game-title > div {
  padding-top: 12px;
  min-width: 0;
}

.game-icon {
  position: relative;
  width: 64px;
  height: 64px;
  flex: none;
  margin-top: -30px;
  border-radius: 14px;
  border: 3px solid var(--card);
  background: var(--card-2);
  object-fit: cover;
}

.game-title h3 {
  margin: 0;
  font-size: 21px;
  line-height: 1.15;
  letter-spacing: -0.025em;
  font-weight: 800;
}

.game-meta {
  margin: 6px 0 0;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--dim);
}

.game-blurb {
  margin: 12px 0 18px;
  font-size: 15.5px;
  color: var(--muted);
  flex: 1;
}

.game-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 0 0 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--line);
  overflow: hidden;
}

.game-stats div {
  padding: 10px 12px;
  background: var(--bg-2);
  min-width: 0;
}

.game-stats dt {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-stats dd {
  margin: 2px 0 0;
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
}

.game-actions {
  display: flex;
  gap: 10px;
}

.game-actions .btn {
  flex: 1;
}

/* the big one gets a wide card */
.game.featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
}

.game.featured .game-thumb {
  aspect-ratio: auto;
  min-height: 100%;
}

.game.featured .game-body {
  padding: 28px;
  justify-content: center;
}

.game.featured .game-title {
  align-items: center;
}

.game.featured .game-title > div {
  padding-top: 0;
}

.game.featured .game-icon {
  width: 76px;
  height: 76px;
  margin-top: 0;
  border-color: var(--line);
}

.game.featured .game-title h3 {
  font-size: clamp(26px, 3.4vw, 40px);
}

.game.featured .game-blurb {
  font-size: 17px;
  flex: none;
}

.game.featured .game-stats dd {
  font-size: 22px;
}

.sub-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 56px 0 20px;
}

.sub-head h3 {
  margin: 0;
  font-size: 26px;
  letter-spacing: -0.03em;
}

.sub-head p {
  margin: 0;
  color: var(--dim);
  font-size: 15px;
}

.load-error {
  grid-column: 1 / -1;
  margin: 0;
  padding: 32px;
  border: 2px dashed var(--line-2);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

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

@media (max-width: 780px) {
  .game.featured {
    grid-template-columns: minmax(0, 1fr);
  }
  .game.featured .game-thumb {
    aspect-ratio: 16 / 9;
  }
  .game.featured .game-body {
    padding: 0 20px 20px;
  }
  .game.featured .game-title {
    align-items: flex-start;
  }
  .game.featured .game-title > div {
    padding-top: 12px;
  }
  .game.featured .game-icon {
    width: 64px;
    height: 64px;
    margin-top: -30px;
    border-color: var(--card);
  }
  .game.featured .game-stats dd {
    font-size: 18px;
  }
}

@media (max-width: 620px) {
  .game-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
}

@media (max-width: 360px) {
  .game-body,
  .game.featured .game-body {
    padding: 0 14px 14px;
  }
  .game-stats div {
    padding: 8px;
  }
  .game-stats dd {
    font-size: 15px;
  }
}

/* ---------- extension ---------- */

.ext {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
  padding: clamp(20px, 4vw, 48px);
  border: 2px solid var(--line);
  border-radius: 24px;
  background: var(--bg-2);
}

.ext-top {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.ext-top img {
  width: 64px;
  height: 64px;
  flex: none;
}

.ext-top .label {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--duck);
}

.ext h3 {
  margin: 2px 0 0;
  font-size: clamp(22px, 3vw, 32px);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.ext > div > p {
  margin: 0 0 18px;
  color: var(--muted);
}

.ext-list {
  margin: 0 0 26px;
  padding: 0 0 0 20px;
  display: grid;
  gap: 6px;
}

.ext-list li::marker {
  color: var(--duck);
}

.ext-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ext-shot {
  width: 100%;
  border-radius: 14px;
  border: 2px solid var(--line-2);
  box-shadow: 8px 8px 0 var(--duck);
}

@media (max-width: 880px) {
  .ext {
    grid-template-columns: minmax(0, 1fr);
  }
  .ext-shot {
    box-shadow: 5px 5px 0 var(--duck);
  }
}

@media (max-width: 420px) {
  .ext-actions .btn {
    flex: 1 1 auto;
  }
}

/* ---------- links + groups ---------- */

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(40px, 6vw, 80px);
}

@media (max-width: 880px) {
  .two-col {
    grid-template-columns: minmax(0, 1fr);
  }
}

.rows {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 2px solid var(--line);
}

.rows a {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding: 16px 4px;
  border-bottom: 2px solid var(--line);
  text-decoration: none;
  transition: padding 0.2s, color 0.2s;
}

@media (hover: hover) {
  .rows a:hover {
    padding-left: 12px;
    color: var(--duck);
  }
}

.rows .row-name {
  flex: 1;
  min-width: 0;
  font-size: clamp(19px, 2.4vw, 25px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.rows .row-name small {
  display: block;
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--dim);
}

.rows .row-side {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
}

.rows .row-arrow {
  flex: none;
  font-size: 20px;
  color: var(--dim);
}

@media (max-width: 400px) {
  .rows a {
    gap: 10px;
  }
  .rows .row-side {
    font-size: 13px;
  }
}

/* ---------- footer ---------- */

.footer {
  margin-top: clamp(72px, 10vw, 128px);
  border-top: 1px solid var(--line);
  padding: 28px 0 calc(32px + env(safe-area-inset-bottom));
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px 24px;
  color: var(--dim);
  font-size: 14px;
}

.brand-sm {
  font-size: 17px;
  color: var(--muted);
}

.brand-sm img {
  width: 26px;
  height: 26px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- 404 ---------- */

.lost {
  min-height: calc(100vh - 65px);
  min-height: calc(100svh - 65px);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 40px 0 72px;
}

.lost-code {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: clamp(6px, 2vw, 20px);
  margin-bottom: 28px;
  font-size: clamp(100px, 26vw, 260px);
  line-height: 0.8;
  font-weight: 800;
  letter-spacing: -0.06em;
}

.lost-code .brick {
  width: 0.72em;
  height: 0.82em;
  animation: drop 0.9s cubic-bezier(0.5, 0, 0.75, 0) 0.2s both, land 0.45s 1.1s ease-out both;
}

.lost-code .brick svg {
  width: 100%;
  height: 100%;
}

@keyframes drop {
  from {
    transform: translateY(-120vh) rotate(-30deg);
  }
  to {
    transform: translateY(0) rotate(8deg);
  }
}

@keyframes land {
  0% {
    transform: rotate(8deg) scaleY(1);
  }
  35% {
    transform: rotate(8deg) scaleY(0.88);
  }
  100% {
    transform: rotate(8deg) scaleY(1);
  }
}

.lost h1 {
  margin: 0 0 10px;
  font-size: clamp(28px, 5vw, 52px);
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.lost p {
  margin: 0 auto 30px;
  max-width: 36ch;
  color: var(--muted);
  font-size: 18px;
}

.lost .path {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--card-2);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.9em;
}

.lost .hero-actions {
  justify-content: center;
}
