/* save.meme — 视觉语言取自 brand/save-banner.svg：细灰线 HUD 框、终端提示符、
   四级灰度条、三级绿色信号条、绿色下划线光标。只做暗色。移动优先。
   /、/early-access、/privacy 是同一个文档：早期访问与隐私说明是叠在首页之上的弹层（无 JS 时见 noscript.css）。
   动效只有首页的背景像素硬币一处（由 site.js 驱动，弹层打开时照常移动，prefers-reduced-motion 下静止）；
   弹层里没有动效，全站不做任何闪烁效果，这里也没有任何 CSS 动画。 */

@font-face {
  font-family: "Geist Mono";
  src: url("/assets/fonts/geist-mono-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* 回退等宽字体按字宽对齐 Geist Mono 的 0.6em，换字体时不产生布局偏移。 */
@font-face {
  font-family: "Geist Mono Fallback Menlo";
  src: local("Menlo"), local("Menlo-Regular");
  size-adjust: 99.66%;
}
@font-face {
  font-family: "Geist Mono Fallback Consolas";
  src: local("Consolas");
  size-adjust: 109.13%;
}

:root {
  --bg: #000000;
  --fg: #f5f5f5;
  --brand: #00f889;
  --line: #aaaaaa;
  --muted: #9a9a9a;
  --muted-2: #b0b0b0;
  --prompt: #c4c4c4;
  --bar-1: #e4e4e4;
  --bar-2: #dadada;
  --bar-3: #999999;
  --bar-4: #454545;
  --mono: "Geist Mono", "Geist Mono Fallback Menlo", "Geist Mono Fallback Consolas", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --stroke: 1px;
  --track-label: 0.07em;
  --track-tagline: 0.39em;
  --corner: 32px;
  /* 硬币位图 32×32，按整数倍放大：移动端 ×4，桌面端 ×5（见文末媒体查询）。 */
  --coin-size: 128px;
  color-scheme: dark;
}

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

html {
  background: var(--bg);
  color: var(--fg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--fg);
}

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

::selection {
  background: var(--brand);
  color: var(--bg);
}

/* ---- 小标签：全大写、字距 0.07em ---- */

.label {
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--muted);
}

/* 带域名的标签保持原样大小写（save.meme 不写成 SAVE.MEME）。 */
.label--keep-case {
  text-transform: none;
}

.prompt {
  color: var(--prompt);
}

/* ---- HUD 线框：45° 切角 + 线端渐隐 ---- */

.hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hud__corner {
  position: absolute;
  width: var(--corner);
  height: var(--corner);
  overflow: visible;
}

.hud__corner path {
  fill: none;
  stroke: var(--line);
  stroke-width: var(--stroke);
  vector-effect: non-scaling-stroke;
}

.hud__corner--tl {
  top: 0;
  left: 0;
}

.hud__corner--br {
  right: 0;
  bottom: 0;
}

.hud__corner--bl {
  bottom: 0;
  left: 0;
}

.hud__line {
  position: absolute;
  display: block;
}

.hud__line--top {
  top: 0;
  left: var(--corner);
  width: min(46%, 640px);
  height: var(--stroke);
  background: linear-gradient(90deg, var(--line) 0 30%, transparent);
}

.hud__line--left {
  top: var(--corner);
  left: 0;
  width: var(--stroke);
  height: min(24%, 150px);
  background: linear-gradient(180deg, var(--line) 0 50%, transparent);
}

.hud__line--bottom {
  right: var(--corner);
  bottom: 0;
  width: min(56%, 760px);
  height: var(--stroke);
  background: linear-gradient(270deg, var(--line) 0 50%, transparent);
}

.hud__line--right {
  right: 0;
  bottom: var(--corner);
  width: var(--stroke);
  height: min(18%, 110px);
  background: linear-gradient(0deg, var(--line) 0 45%, transparent);
}

.hud__line--bl {
  bottom: var(--corner);
  left: 0;
  width: var(--stroke);
  height: min(16%, 120px);
  background: linear-gradient(0deg, var(--line) 0 35%, transparent);
}

.hud__line--tr {
  top: 10px;
  right: 0;
  width: var(--stroke);
  height: min(18%, 130px);
  background: linear-gradient(180deg, var(--line) 0 65%, transparent);
}

/* ---- 四级灰度条与三级绿色信号条 ---- */

.bars4 {
  display: inline-flex;
  align-items: flex-end;
  gap: 5px;
}

.bars4 i {
  display: block;
  width: 4px;
  height: 11px;
  background: var(--bar-4);
}

.bars4 i:nth-child(1) {
  background: var(--bar-1);
}

.bars4 i:nth-child(2) {
  background: var(--bar-2);
}

.bars4 i:nth-child(3) {
  background: var(--bar-3);
}

.bars4--low i:not(:first-child) {
  background: var(--bar-4);
}

.bars3 {
  display: inline-flex;
  align-items: flex-end;
  gap: 3px;
  height: 15px;
}

.bars3 i {
  display: block;
  width: 4px;
  background: var(--bar-4);
}

.bars3 i:nth-child(1) {
  height: 31%;
}

.bars3 i:nth-child(2) {
  height: 64%;
}

.bars3 i:nth-child(3) {
  height: 100%;
}

.bars3[data-level="1"] i:nth-child(-n + 1),
.bars3[data-level="2"] i:nth-child(-n + 2),
.bars3[data-level="3"] i {
  background: var(--brand);
}

/* ---- 绿色下划线光标（静止）：行内块，下沿落在所在文字的基线上。
   所在元素不能是 flex / grid 容器（会把光标当作单独的项目对齐），否则就不再贴基线。 ---- */

.cursor {
  display: inline-block;
  width: 1.1em;
  height: max(2px, 0.16em);
  margin-left: 0.35em;
  background: var(--brand);
  vertical-align: baseline;
}

/* ---- logo 与标语 ---- */

.mark {
  display: block;
  width: 100%;
  height: auto;
  fill: var(--brand);
}

.lockup {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.lockup__logo {
  width: clamp(230px, 64vw, 560px);
  margin: 0;
}

.tagline {
  margin: 1.5em -0.39em 0 0;
  font-size: clamp(11px, 3.05vw, 21px);
  line-height: 1.2;
  letter-spacing: var(--track-tagline);
  white-space: nowrap;
  color: var(--fg);
}

.tagline__accent {
  color: var(--brand);
}

/* ---- 首页：一屏构图 ---- */

/* 背景像素硬币：32×32 位图按整数倍放大（pixelated）；只用 transform 移动，不产生布局偏移。
   整层不透明度 0.22：硬币最亮的像素（品牌绿）叠在最暗的文字（#9A9A9A）下时对比度仍 ≥ 4.5:1。 */
.coin {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 0;
  width: var(--coin-size);
  height: var(--coin-size);
  opacity: 0.22;
  image-rendering: pixelated;
  pointer-events: none;
  visibility: hidden;
  will-change: transform;
}

.coin.is-ready {
  visibility: visible;
}

.home {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  min-height: calc(100vh - 24px);
  min-height: calc(100svh - 24px);
  margin: 12px;
  padding: 24px 12px 16px;
}

.home__bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas:
    "bars . cta"
    "tags tags tags";
  align-items: center;
  row-gap: 8px;
}

.home__bars {
  grid-area: bars;
  padding-left: 14px;
}

.home__tags {
  grid-area: tags;
  margin: 0;
  padding-left: 14px;
  white-space: nowrap;
}

/* 普通行内排版（不用 flex），光标才会贴着文字基线；上下内边距把可点区域撑到 44px。 */
.home__cta {
  grid-area: cta;
  display: inline-block;
  padding: 13px 0;
  color: var(--fg);
}

.home__cta:hover {
  color: var(--brand);
}

.home__center {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px 0;
}

/* 底部一行：左下 > TRADE / HODL / BUIDL，右下 X、邮箱图标与三级信号条。
   右下三者视觉高度都是 18px、相邻间距都是 26px，在同一条水平线上垂直居中；BUIDL 的基线与三者的下沿对齐。 */
.home__foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 0 0 0 14px;
}

.home__list {
  margin: 0 0 6.6px;
  padding: 0;
  list-style: none;
  color: var(--muted-2);
  font-size: 12px;
  line-height: 1.7;
  letter-spacing: var(--track-label);
}

.home__list li {
  position: relative;
  padding-left: 1.7em;
}

.home__list .prompt {
  position: absolute;
  left: 0;
}

.home__corner {
  display: flex;
  align-items: center;
}

.social {
  display: flex;
  align-items: center;
}

/* 图标高 18px（与小标签行高一致，宽高写在 svg 属性里）；四周 13px 内边距把可点区域撑到不小于 44×44，
   同时满足 X 品牌指南的留白（每边至少为 logo 宽度的 25%）。两个图标之间因此相距 26px。 */
.social__link {
  display: block;
  padding: 13px;
}

.social__icon {
  display: block;
}

/* 悬停与键盘聚焦：图标整体变为品牌绿，与 EARLY ACCESS 的悬停一致，不加下划线光标。
   X logo 平时白色、此时品牌绿，偏离 X 品牌指南的单色要求，是 Butter 2026-10-05 的决定（见 README）。 */
.social__link:hover .social__icon path,
.social__link:focus-visible .social__icon path {
  fill: var(--brand);
}

/* 信号条不是链接，没有悬停效果；高度与图标一致，与邮箱图标相距 26px（邮箱链接的 13px 内边距 + 13px）。 */
.home__signal {
  height: 18px;
  margin-left: 13px;
}

/* 一行小号灰字：按视口宽度缩放，360px 起保证不换行。 */
.home__disclaimer {
  justify-self: center;
  max-width: 100%;
  margin: 18px 0 6px;
  color: var(--muted);
  font-size: clamp(9.5px, 2.75vw, 12px);
  line-height: 1.5;
  text-align: center;
}

@media (min-width: 360px) {
  .home__disclaimer {
    white-space: nowrap;
  }
}

/* ---- 弹层：一个原生 <dialog>、一层遮罩，里面是早期访问与隐私说明两个面板，同一时间只显示一个 ---- */

html.is-modal-open {
  overflow: hidden;
}

.sheet {
  --sheet-width: 640px;
  position: fixed;
  inset: 0;
  z-index: 10;
  width: min(100% - 32px, var(--sheet-width));
  max-width: none;
  height: fit-content;
  max-height: calc(100% - 32px);
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 0;
  background: transparent;
  color: var(--fg);
}

.sheet[data-active="early-access"] {
  --sheet-width: 560px;
}

.sheet:not([open]) {
  display: none;
}

/* 遮罩：纯半透明黑（80%），不模糊；背景硬币在下面照常移动。 */
.sheet::backdrop {
  background: rgba(0, 0, 0, 0.8);
}

/* 直接访问 /early-access、/privacy 时，弹层在 HTML 里按非模态打开；脚本接管（升级为模态）之前，
   或脚本没能加载时，用同样的暗化盖住首页。 */
.sheet[open]:not(:modal) {
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.8);
}

/* 面板本身是不透明的黑底，文字不受背后硬币与首页的影响。 */
.sheet__panel {
  position: relative;
  padding: 18px 18px 20px;
  background: var(--bg);
}

.sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.sheet__title {
  margin: 0;
  color: var(--fg);
  font-size: 13px;
  font-weight: 400;
}

/* 上下内边距把可点区域撑到 44px。 */
.sheet__close,
.sheet__link {
  display: inline-block;
  padding: 13px 4px;
  color: var(--muted-2);
}

.sheet__foot {
  margin: 4px 0 -12px;
  text-align: center;
}

.sheet__panel--early .sheet__head {
  margin-bottom: 14px;
}

.form {
  display: grid;
  gap: 22px;
}

/* 表单与成功态叠在同一格：成功后表单只是隐藏（visibility），弹层尺寸不变，不产生布局偏移。 */
.sheet__body {
  display: grid;
}

.sheet__body > .form,
.sheet__body > .success {
  grid-area: 1 / 1;
}

.form.is-done {
  visibility: hidden;
}

.success[hidden] {
  display: none;
}

.field {
  display: grid;
  gap: 8px;
}

.field__input {
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 16px;
  line-height: 1.5;
}

.field__input::placeholder {
  color: var(--bar-3);
  opacity: 1;
}

.field__input:focus-visible {
  outline-offset: 0;
}

.field__input[aria-invalid="true"] {
  border-color: var(--fg);
}

.field__handle {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
}

.field__handle:focus-within {
  outline: 2px solid var(--brand);
}

.field__handle .field__input {
  border: 0;
  padding-left: 6px;
}

.field__handle .field__input:focus-visible {
  outline: none;
}

.field__at {
  padding-left: 14px;
  color: var(--muted);
  font-size: 16px;
}

.consent {
  display: grid;
  grid-template-columns: 24px 1fr;
  column-gap: 14px;
  align-items: start;
}

.consent__box {
  appearance: none;
  -webkit-appearance: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin: 1px 0 0;
  border: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  cursor: pointer;
}

.consent__box::after {
  content: "";
  width: 6px;
  height: 11px;
  margin-top: -2px;
  border: solid var(--bg);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  opacity: 0;
}

.consent__box:checked {
  border-color: var(--brand);
  background: var(--brand);
}

.consent__box:checked::after {
  opacity: 1;
}

.consent__box[aria-invalid="true"] {
  border-color: var(--fg);
}

.consent__label {
  color: var(--muted-2);
  cursor: pointer;
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 22px;
}

/* 人机验证状态行 + 提交按钮；需要交互时 Turnstile 盖住这两行，不占文档流。 */
.verify {
  position: relative;
  display: grid;
  gap: 22px;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
  min-height: 52px;
  padding: 12px 18px;
  border: 0;
  border-radius: 0;
  background: var(--brand);
  color: var(--bg);
  font: inherit;
  font-size: 13px;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  cursor: pointer;
}

.btn:focus-visible {
  outline-color: var(--fg);
}

.btn[aria-busy="true"] {
  cursor: progress;
  opacity: 0.7;
}

.ts {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  pointer-events: none;
}

.ts.is-interactive {
  background: var(--bg);
  pointer-events: auto;
}

.status {
  min-height: 1.6em;
  margin: 16px 0 0;
  color: var(--fg);
}

.status:empty::before {
  content: "\00a0";
}

.status[data-tone="error"]::before {
  content: "! ";
  color: var(--brand);
}

/* 成功：文字由成功面板显示，status 只给读屏播报；保留占位，弹层尺寸不变。 */
.status[data-tone="done"] {
  opacity: 0;
}

.success {
  padding-top: 4px;
}

.success:focus {
  outline: none;
}

.success__title {
  margin: 0 0 10px;
  color: var(--muted-2);
  font-size: clamp(18px, 3.2vw, 22px);
  line-height: 1.4;
}

.success__title strong {
  color: var(--fg);
  font-weight: 400;
}

.success__body {
  margin: 0;
  color: var(--muted);
}

/* ---- 隐私说明正文 ---- */

.privacy__updated {
  margin: 0 0 10px;
}

.privacy__list {
  display: grid;
  gap: 9px;
  margin: 0;
}

.privacy__item {
  display: grid;
  gap: 2px;
}

.privacy__item dd {
  margin: 0;
  color: var(--muted-2);
  font-size: 13px;
  line-height: 1.5;
}

.privacy__item a {
  color: var(--fg);
  text-decoration: underline;
  text-decoration-color: var(--brand);
  text-underline-offset: 3px;
}

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

.nf {
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 16px;
}

.nf__panel {
  position: relative;
  width: min(100%, 640px);
  padding: 40px 26px 34px;
}

.nf__title {
  margin: 20px 0 12px;
  font-size: clamp(20px, 4.2vw, 28px);
  font-weight: 400;
  line-height: 1.35;
}

.nf__body {
  margin: 0 0 22px;
  color: var(--muted);
}

.nf__home {
  margin: 0;
}

.nf__home a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted-2);
}

/* ---- 平板与桌面 ---- */

@media (min-width: 720px) {
  .home {
    margin: 20px;
    min-height: calc(100vh - 40px);
    min-height: calc(100svh - 40px);
    padding: 28px 30px 18px;
  }

  .home__bar {
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "bars tags cta";
    column-gap: 22px;
  }

  .home__tags {
    padding-left: 0;
  }

  .sheet__panel {
    padding: 28px 36px 30px;
  }

  .privacy__updated {
    margin-bottom: 16px;
  }

  .privacy__list {
    gap: 12px;
  }

  .privacy__item {
    grid-template-columns: 10.5em 1fr;
    gap: 18px;
  }

  .privacy__item dd {
    font-size: 14px;
    line-height: 1.6;
  }

  .privacy__item dt {
    padding-top: 2px;
  }

  .nf__panel {
    padding: 48px 40px 40px;
  }
}

@media (min-width: 960px) {
  :root {
    --coin-size: 160px;
  }
}
