:root {
  --bg: #f6edd9;
  --board: #f8f1e2;
  --paper: #fffaf1;
  --ink: #161616;
  --pink: #ff92c2;
  --orange: #ff8a3d;
  --teal: #46d6c8;
  --yellow: #ffe56a;
  --blue: #a9c8ff;
  --border: 3px solid var(--ink);
  --shadow: 5px 5px 0 var(--ink);
  --radius: 22px;
  --font-display: "Inter", "Segoe UI", sans-serif;
  --font-body: "Inter", "Segoe UI", sans-serif;
  --wallpaper: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='280' height='280' viewBox='0 0 280 280' fill='none'%3E%3Crect x='26' y='30' width='26' height='26' rx='3' fill='%233DDC4A'/%3E%3Cg stroke='%23161616' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round' opacity='0.5' transform='translate(156 36)'%3E%3Cpath d='M9 2L2 12L9 22'/%3E%3Cpath d='M16 2L11 22'/%3E%3Cpath d='M18 2L25 12L18 22'/%3E%3C/g%3E%3Crect x='52' y='154' width='36' height='36' rx='10' stroke='%23161616' stroke-width='2.4' opacity='0.38'/%3E%3Crect x='168' y='178' width='62' height='22' rx='11' fill='%23ff92c2' opacity='0.8'/%3E%3Cg fill='%23161616' opacity='0.38'%3E%3Crect x='214' y='92' width='6' height='6'/%3E%3Crect x='224' y='92' width='6' height='6'/%3E%3Crect x='214' y='102' width='6' height='6'/%3E%3Crect x='224' y='102' width='6' height='6'/%3E%3C/g%3E%3Cpath d='M34 214h16a12 12 0 0 1 12 12v16' stroke='%23161616' stroke-width='2.4' stroke-linecap='round' opacity='0.38'/%3E%3Crect x='118' y='104' width='16' height='16' rx='3' fill='%23ffe56a'/%3E%3Ccircle cx='236' cy='228' r='7' fill='%2346d6c8'/%3E%3Crect x='96' y='228' width='18' height='12' rx='3' fill='%23ff8a3d'/%3E%3C/svg%3E");
}

body {
  background-color: var(--bg);
}

body::before {
  content: "";
  position: fixed;
  z-index: 0;
  inset: -32px;
  pointer-events: none;
  background-image: var(--wallpaper);
  background-size: 280px 280px;
  transform: translate(var(--wallpaper-x, 0px), var(--wallpaper-y, 0px));
}

.page {
  position: relative;
  z-index: 1;
}

@media (prefers-reduced-motion: no-preference) {
  body::before {
    animation: gocify-wallpaper 90s linear infinite;
  }
}

@keyframes gocify-wallpaper {
  to { background-position: 280px 280px; }
}

@view-transition {
  navigation: auto;
}

html:active-view-transition {
  overflow: hidden;
}

.board {
  view-transition-name: board;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
}

::view-transition-old(root) {
  display: none;
}

::view-transition-group(board) {
  overflow: visible;
}

::view-transition-old(board) {
  animation: 380ms cubic-bezier(0.22, 1, 0.36, 1) both slide-to-right;
}

::view-transition-new(board) {
  animation: 380ms cubic-bezier(0.22, 1, 0.36, 1) both slide-from-left;
}

:root:active-view-transition-type(back)::view-transition-old(board) {
  animation-name: slide-to-left;
}

:root:active-view-transition-type(back)::view-transition-new(board) {
  animation-name: slide-from-right;
}

@keyframes slide-from-left {
  from { transform: translateX(-100vw); }
  to { transform: translateX(0); }
}

@keyframes slide-to-right {
  from { transform: translateX(0); }
  to { transform: translateX(100vw); }
}

@keyframes slide-from-right {
  from { transform: translateX(100vw); }
  to { transform: translateX(0); }
}

@keyframes slide-to-left {
  from { transform: translateX(0); }
  to { transform: translateX(-100vw); }
}

@media (prefers-reduced-motion: reduce) {
  @view-transition {
    navigation: none;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.65;
}

.page { padding: 22px 16px 48px; }

.shell {
  max-width: 1120px;
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding: 8px 12px;
  background: var(--paper);
  border: var(--border);
  border-radius: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  line-height: 0;
  text-decoration: none;
}

.brand-logo {
  display: block;
  height: 72px;
  width: auto;
  border: var(--border);
}

.top-actions {
  display: flex;
  align-items: center;
}

.langs {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  border: var(--border);
  border-radius: 999px;
  background: var(--paper);
}

.langs::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: 0;
  bottom: 0;
  left: 0;
  width: 50%;
  border-radius: 999px;
  background: var(--ink);
  transform: translateX(0);
  transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

html[data-lang="en"] .langs::before,
.langs[data-lang="en"]::before {
  transform: translateX(100%);
}

.langs button {
  position: relative;
  z-index: 1;
  min-width: 46px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 800;
  padding: 8px 12px;
  cursor: pointer;
}

html[data-lang="vi"] .langs button[data-lang="vi"],
html[data-lang="en"] .langs button[data-lang="en"],
.langs button[aria-pressed="true"] {
  color: var(--yellow);
}

.board {
  overflow: hidden;
  background: var(--board);
  border: var(--border);
  border-radius: 28px;
}

.board-clip {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

.board.is-collapsed .board-clip {
  grid-template-rows: 0fr;
}

.board-inner {
  min-height: 0;
  overflow: hidden;
}

.board-pad {
  padding: 22px 20px 28px;
}

.jump { margin: 0 0 18px; }

.sticker {
  display: inline-flex;
  padding: 10px 16px;
  border: var(--border);
  border-radius: 999px;
  background: var(--yellow);
  box-shadow: 3px 3px 0 var(--ink);
  color: inherit;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 7vw, 4.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 0.9;
  text-transform: uppercase;
}

.meta { margin: 0 0 8px; font-weight: 700; }

.lang {
  display: inline-block;
  margin: 0;
  padding: 4px 10px;
  border: var(--border);
  border-radius: 999px;
  background: var(--teal);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

#policy-vi { margin-top: 12px; }
#policy-vi .lang { background: var(--yellow); }

html[data-lang="vi"] .only-en,
html[data-lang="en"] .only-vi,
html[data-lang="vi"] #policy-en,
html[data-lang="en"] #policy-vi,
html[data-lang] .lang {
  display: none;
}

h2 {
  margin: 1.5rem 0 0.6rem;
  padding-top: 0.8rem;
  border-top: var(--border);
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.15;
}

a { color: inherit; font-weight: 700; }

code {
  padding: 1px 6px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--yellow);
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

@media (max-width: 800px) {
  .page { padding: 10px; }
  .brand-logo { height: 56px; }
}

@media (prefers-reduced-motion: reduce) {
  .langs::before,
  .langs button,
  .board-clip { transition: none; }
}
