/* Max's site: a workshop blueprint. Everything sits on grid paper; the hero is a drawing sheet
   with callouts and a title block, products are parts with sticker labels. */
:root {
  --paper: #eaf1fb;
  --grid: #cfddf3;
  --grid-major: #b5c9ec;
  --ink: #13233f;
  --ink-soft: #3d5073;
  --yellow: #ffc93c;
  --red: #ef4b3c;
  --sky: #4da3ff;
  --white: #ffffff;
  --display: 'Baloo 2', 'Arial Rounded MT Bold', system-ui, sans-serif;
  --body: 'Lexend', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --line: 3px solid var(--ink);
  --radius: 14px;
}

* { box-sizing: border-box; }
body.max {
  margin: 0;
  color: var(--ink);
  font: 400 1rem/1.6 var(--body);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; border-radius: 6px; }

.skip { position: absolute; left: 12px; top: -60px; background: var(--ink); color: var(--white); padding: 8px 14px; border-radius: 8px; z-index: 10; }
.skip:focus { top: 12px; }

main, .hero, .topbar, .foot { width: min(1080px, calc(100% - 32px)); margin-inline: auto; }

/* ---------- hero: the drawing sheet ---------- */
.hero { padding-top: 28px; }
.sheet {
  position: relative;
  background: rgba(255, 255, 255, 0.55);
  border: var(--line);
  border-radius: 4px;
  outline: 1px solid var(--ink);
  outline-offset: 6px;
  padding: 36px 28px 28px;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  grid-template-areas:
    "kicker crew"
    "title crew"
    "tagline crew"
    "bio crew"
    "socials crew"
    "block block";
  column-gap: 28px;
}
.kicker {
  grid-area: kicker;
  margin: 0;
  font: 500 0.78rem/1.2 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.hero h1 {
  grid-area: title;
  margin: 10px 0 6px;
  font: 800 clamp(2.6rem, 7vw, 4.6rem)/0.98 var(--display);
  letter-spacing: -0.01em;
  position: relative;
  padding-bottom: 22px;
}
.hero h1 span { background: linear-gradient(transparent 58%, var(--yellow) 58%, var(--yellow) 90%, transparent 90%); padding-inline: 4px; }
/* A dimension line under the name, as on a technical drawing. */
.hero h1::after {
  content: '';
  position: absolute; left: 0; right: 12%; bottom: 6px; height: 10px;
  border-left: 2px solid var(--ink); border-right: 2px solid var(--ink);
  background: linear-gradient(var(--ink), var(--ink)) center / 100% 2px no-repeat;
}
.tagline { grid-area: tagline; margin: 8px 0 0; font: 600 1.35rem/1.3 var(--display); color: var(--red); }
.bio { grid-area: bio; margin: 10px 0 0; max-width: 44ch; color: var(--ink-soft); }

.crew {
  grid-area: crew;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  min-height: 300px;
  padding-top: 26px;
}
.fig { position: relative; display: block; }
.fig-dad img { height: 290px; width: auto; }
.fig-max img { height: 230px; width: auto; }
.fig-bot img { height: 120px; width: auto; margin-bottom: 8px; }
.callout {
  position: absolute; top: -22px; left: 50%;
  transform: translateX(-50%);
  font: 500 0.72rem/1 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 5px 9px;
  white-space: nowrap;
}
.callout::after { content: ''; position: absolute; left: 50%; top: 100%; width: 2px; height: 14px; background: var(--ink); }
.fig-bot .callout { top: -30px; }

.socials { grid-area: socials; list-style: none; margin: 22px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.socials a {
  display: inline-block;
  text-decoration: none;
  font: 700 1rem/1 var(--display);
  padding: 12px 18px 10px;
  border: var(--line);
  border-radius: 999px;
  background: var(--sky);
  color: var(--ink);
  box-shadow: 0 4px 0 var(--ink);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.socials li:nth-child(3n+2) a { background: var(--yellow); }
.socials li:nth-child(3n+3) a { background: var(--red); color: var(--white); }
.socials a:hover { transform: translateY(2px); box-shadow: 0 2px 0 var(--ink); }

.titleblock {
  grid-area: block;
  justify-self: end;
  margin: 26px -28px -28px 0;
  display: grid;
  grid-template-columns: auto auto;
  border-top: var(--line);
  border-left: var(--line);
  font: 500 0.72rem/1.2 var(--mono);
}
.titleblock div { padding: 8px 14px; }
.titleblock div + div { border-left: 2px solid var(--ink); }
.titleblock dt { text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-soft); }
.titleblock dd { margin: 3px 0 0; font-size: 0.85rem; color: var(--ink); }

/* ---------- section headings: stickers ---------- */
main { padding-block: 40px 20px; }
.log h2, .shelf h2 { margin: 0 0 18px; font: 800 1.9rem/1 var(--display); }
.log > h2 { display: inline-block; background: var(--ink); color: var(--white); padding: 10px 18px 6px; border-radius: 10px; transform: rotate(-1.5deg); }
.sticker {
  display: inline-block;
  background: var(--yellow);
  border: var(--line);
  border-radius: 10px;
  padding: 10px 18px 6px;
  transform: rotate(-2deg);
  box-shadow: 3px 3px 0 var(--ink);
}
.shelf:nth-of-type(3n+2) .sticker { background: var(--sky); transform: rotate(1.5deg); }
.shelf:nth-of-type(3n+3) .sticker { background: var(--red); color: var(--white); transform: rotate(-1deg); }
.shelf, .log { margin-bottom: 48px; }

/* ---------- Bố kể: notes pinned to the sheet ---------- */
.log-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.log-item a {
  position: relative;
  display: grid;
  gap: 6px;
  height: 100%;
  text-decoration: none;
  background: var(--white);
  border: var(--line);
  border-radius: var(--radius);
  padding: 22px 20px 18px;
}
.log-item a::before {
  content: ''; position: absolute; top: -9px; left: 22px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--red); border: 2px solid var(--ink);
}
.log-item time { font: 500 0.75rem/1 var(--mono); color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.05em; }
.log-item strong { font: 800 1.3rem/1.15 var(--display); }
.log-item span { color: var(--ink-soft); font-size: 0.95rem; }
.log-item a:hover strong { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 3px; text-decoration-color: var(--yellow); }
.more { display: inline-block; margin-top: 16px; font: 700 1.05rem/1 var(--display); color: var(--ink); text-decoration-color: var(--red); text-decoration-thickness: 3px; text-underline-offset: 5px; }

/* ---------- gear: parts with labels ---------- */
.gear-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 20px; }
.gear-card a {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  text-decoration: none;
  background: var(--white);
  border: var(--line);
  border-radius: var(--radius);
  padding: 12px 12px 14px;
  box-shadow: 5px 5px 0 var(--ink);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.gear-card a:hover { transform: translate(2px, 2px); box-shadow: 3px 3px 0 var(--ink); }
.gear-card img, .gear-card .noimg { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 9px; border: 2px solid var(--ink); background: var(--paper); }
.gear-card .noimg { background: var(--paper) url(/_t/max/mascot.webp) center / 38% no-repeat; }
.gear-name { font: 700 1.05rem/1.25 var(--display); }
.gear-note { font-size: 0.9rem; color: var(--ink-soft); }
.gear-go { align-self: flex-start; margin-top: auto; font: 500 0.78rem/1 var(--mono); text-transform: uppercase; letter-spacing: 0.05em; background: var(--yellow); border: 2px solid var(--ink); border-radius: 999px; padding: 6px 10px; }

/* ---------- tủ đồ: one parts bin per owner ---------- */
.bins { margin-bottom: 48px; }
.bin-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.bin {
  display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: baseline;
  text-decoration: none; background: var(--white); border: var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: 5px 5px 0 var(--ink); transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.bin:hover { transform: translate(2px, 2px); box-shadow: 3px 3px 0 var(--ink); }
.bin-label { font: 800 1.35rem/1.1 var(--display); }
.bin-count { font: 500 0.78rem/1 var(--mono); text-transform: uppercase; letter-spacing: 0.05em; background: var(--yellow); border: 2px solid var(--ink); border-radius: 999px; padding: 5px 9px; }
.bin-peek { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 6px; }
.bin-peek img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 7px; border: 2px solid var(--ink); }
.bin-grid li:nth-child(3n+2) .bin-count { background: var(--sky); }
.bin-grid li:nth-child(3n+3) .bin-count { background: var(--red); color: var(--white); }
.badge { align-self: flex-start; font: 500 0.7rem/1 var(--mono); text-transform: uppercase; letter-spacing: 0.05em; background: var(--red); color: var(--white); border-radius: 6px; padding: 4px 7px; transform: rotate(-2deg); }

/* ---------- browse page: sticker chips ---------- */
.catalog h1 { font: 800 clamp(2rem, 5.5vw, 3rem)/1.05 var(--display); margin: 0 0 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.chips a {
  text-decoration: none; font: 700 0.95rem/1 var(--display); background: var(--white);
  border: 2px solid var(--ink); border-radius: 999px; padding: 9px 13px 7px;
}
.chips a span { font: 500 0.72rem/1 var(--mono); color: var(--ink-soft); margin-left: 3px; }
.chips a[aria-current="page"] { background: var(--ink); color: var(--white); }
.chips a[aria-current="page"] span { color: var(--yellow); }
.chips + .chips a { border-style: dashed; }
.chips + .chips a[aria-current="page"] { border-style: solid; background: var(--yellow); color: var(--ink); }
.chips + .chips a[aria-current="page"] span { color: var(--ink); }
.catalog .gear-grid { margin-top: 26px; }
.pager { display: flex; justify-content: space-between; align-items: center; margin: 32px 0 10px; font: 700 1.05rem/1 var(--display); }
.pager span { font: 500 0.8rem/1 var(--mono); color: var(--ink-soft); }
.pager a { background: var(--white); border: var(--line); border-radius: 999px; padding: 10px 16px 7px; text-decoration: none; }
.topbar nav { display: flex; gap: 16px; }

/* ---------- inner pages ---------- */
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 22px; font: 700 1.1rem/1 var(--display); }
.topbar a { text-decoration: none; }
.topbar .home { background: var(--white); border: var(--line); border-radius: 999px; padding: 10px 16px 7px; }
.page h1, .lost h1 { font: 800 clamp(2.2rem, 6vw, 3.4rem)/1 var(--display); margin: 0 0 24px; }
.empty { font-size: 1.1rem; color: var(--ink-soft); }

.article article { background: var(--white); border: var(--line); border-radius: var(--radius); padding: clamp(22px, 5vw, 48px); margin-bottom: 48px; }
.article header time { font: 500 0.78rem/1 var(--mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); }
.article h1 { font: 800 clamp(2rem, 5.5vw, 3.2rem)/1.05 var(--display); margin: 10px 0 12px; max-width: 22ch; }
.lede { font-size: 1.2rem; color: var(--ink-soft); max-width: 60ch; margin: 0 0 24px; }
.for-max {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 16px;
  align-items: center;
  background: var(--yellow);
  border: var(--line);
  border-radius: 18px 18px 18px 4px;
  padding: 16px 20px;
  margin: 0 0 28px;
  max-width: 62ch;
  transform: rotate(-0.6deg);
}
.for-max img { width: 84px; }
.for-max h2 { margin: 0 0 4px; font: 800 1.15rem/1.1 var(--display); }
.for-max p { margin: 0; font-size: 1.12rem; line-height: 1.5; }
.prose { max-width: 65ch; font-size: 1.06rem; }
.prose h2, .prose h3 { font: 800 1.6rem/1.15 var(--display); margin: 1.6em 0 0.4em; }
.prose p { margin: 0 0 1em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li::marker { color: var(--red); }
.verdict { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 30px; max-width: 65ch; }
.verdict section { border: var(--line); border-radius: var(--radius); padding: 14px 18px; }
.verdict .pros { background: #e3f0ff; }
.verdict .cons { background: #ffe7e4; }
.verdict h2 { margin: 0 0 8px; font: 800 1.2rem/1 var(--display); }
.verdict ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.verdict li { padding-left: 26px; position: relative; }
.verdict li::before { position: absolute; left: 0; font: 800 1.1rem/1.4 var(--display); }
.verdict .pros li::before { content: '+'; color: #1a6fd1; }
.verdict .cons li::before { content: '−'; color: var(--red); }

.lost { text-align: center; padding-block: 60px; }
.lost img { width: 150px; margin: 0 auto 18px; transform: rotate(-8deg); }

/* ---------- footer ---------- */
.foot { border-top: var(--line); padding: 20px 0 40px; margin-top: 20px; font-size: 0.85rem; color: var(--ink-soft); }
.foot .disclosure { margin: 0 0 8px; max-width: 70ch; }
.foot a { font-weight: 600; color: var(--ink); }

/* ---------- small screens ---------- */
@media (max-width: 760px) {
  .sheet {
    grid-template-columns: 1fr;
    grid-template-areas: "kicker" "title" "tagline" "bio" "crew" "socials" "block";
    padding: 28px 18px 20px;
    outline-offset: 4px;
  }
  .crew { min-height: 0; padding-top: 34px; }
  .fig-dad img { height: 190px; }
  .fig-max img { height: 150px; }
  .fig-bot img { height: 82px; }
  .titleblock { justify-self: stretch; margin: 22px -18px -20px; grid-template-columns: 1fr 1fr; border-left: 0; }
  .verdict { grid-template-columns: 1fr; }
  .gear-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
  .gear-card a { padding: 8px 8px 10px; box-shadow: 3px 3px 0 var(--ink); }
  .gear-name { font-size: 0.95rem; }
  .gear-note { font-size: 0.82rem; }
  .gear-go { font-size: 0.66rem; padding: 5px 8px; }
  .for-max { grid-template-columns: 56px 1fr; }
  .for-max img { width: 56px; }
}

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