@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 520 680;
  font-display: swap;
  src: url("fonts/fraunces-normal-560.woff2") format("woff2");
}
@font-face {
  font-family: "Fraunces";
  font-style: italic;
  font-weight: 420 500;
  font-display: swap;
  src: url("fonts/fraunces-italic-460.woff2") format("woff2");
}
@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("fonts/outfit-normal-400.woff2") format("woff2");
}

:root {
  --bg: #f3f0e8;
  --surface: #fffcf7;
  --fg: #1c1915;
  --muted: #5e574e;
  --accent: #4f46c8;
  --accent-fg: #f6f5ff;
  --line: #e3dcd0;
  --chip: #ebe4d8;
  --sans: "Outfit", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --serif: "Fraunces", "Iowan Old Style", "New York", "Songti SC", "Noto Serif SC", serif;
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #100f0d;
  --surface: #1b1916;
  --fg: #f4efe6;
  --muted: #b7b0a4;
  --accent: #c9c6ff;
  --accent-fg: #1a1730;
  --line: #322f2a;
  --chip: #24221e;
  color-scheme: dark;
}

[hidden] { display: none !important; }
.x svg { width: 1rem; height: 1rem; }
html { -webkit-tap-highlight-color: transparent; background: var(--bg); width: 100%; max-width: 100%; overflow-x: hidden; overflow-x: clip; overscroll-behavior-x: none; touch-action: pan-y; }
body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-x: clip;
  font-family: var(--sans);
  color: var(--fg);
  background:
    radial-gradient(120% 56% at 50% -12%, color-mix(in oklab, var(--accent) 14%, transparent), transparent 58%),
    var(--bg);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
button, a { color: inherit; }
button { font: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { text-decoration: none; }
::selection { background: color-mix(in oklab, var(--accent) 28%, white); color: var(--fg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

*, *::before, *::after { box-sizing: border-box; }
.page {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  overflow-x: clip;
  padding:
    max(1.25rem, env(safe-area-inset-top))
    max(1rem, env(safe-area-inset-right))
    max(2.5rem, env(safe-area-inset-bottom))
    max(1rem, env(safe-area-inset-left));
}
.stage, .stage-side, .stage-main { max-width: 100%; min-width: 0; }
@media (min-width: 640px) { .page { padding-top: 3.5rem; } }
@media (min-width: 980px) {
  .page { width: min(100% - 4rem, 64rem); padding-top: 4.25rem; }
  .stage {
    display: grid;
    grid-template-columns: 20rem minmax(0, 1fr);
    column-gap: 3.25rem;
    align-items: start;
  }
  .stage-side { position: sticky; top: 2.75rem; }
  .stage-main {
    border-left: 1px solid var(--line);
    padding-left: 3.25rem;
  }
  .stage-main > :first-child { margin-top: 0; }
}

.top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.75rem; }
.kicker { margin: 0; font-size: 0.75rem; font-weight: 500; letter-spacing: 0.22em; color: var(--muted); }

.who { display: flex; align-items: center; gap: 1rem; max-width: 100%; min-width: 0; }
.avatar-btn { position: relative; width: 5rem; height: 5rem; flex: none; border-radius: 999px; }
.avatar {
  width: 5rem; height: 5rem; border-radius: 999px; object-fit: cover; display: block;
  box-shadow: 0 16px 36px -22px var(--fg);
  box-shadow: 0 16px 36px -22px color-mix(in srgb, var(--fg) 70%, transparent);
  outline: 1px solid var(--line);
}
.name {
  margin: 0;
  font-family: var(--serif);
  font-weight: 560;
  font-size: clamp(1.85rem, 9vw, 2.65rem);
  line-height: 0.92;
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
  font-variation-settings: "opsz" 80, "SOFT" 40, "WONK" 1, "wght" 560;
}
.name i { color: var(--accent); font-style: normal; }
.sub { margin: 0.45rem 0 0; font-size: 0.875rem; color: var(--muted); }
.sub + .sub { margin-top: 0; }

.motto {
  display: block; margin: 1.5rem 0 0; text-align: left; max-width: 100%;
}
.motto p { margin: 0; }
.quote {
  font-family: var(--serif); font-style: italic; font-weight: 460; font-size: 1.05rem; line-height: 1.55;
  font-variation-settings: "opsz" 16, "SOFT" 30, "wght" 460;
}
.year { margin-right: 0.5rem; font-family: var(--sans); font-style: normal; font-weight: 500; font-size: 0.75rem; letter-spacing: 0.04em; color: var(--accent); }
.en { margin: 0.7rem 0 0; font-size: 0.75rem; line-height: 1.55; color: var(--muted); }
.tags { margin: 0.75rem 0 0; font-size: 0.75rem; letter-spacing: 0.04em; color: var(--muted); }

.social { display: flex; flex-wrap: wrap; gap: 0.625rem; margin-top: 1.25rem; max-width: 100%; }
.social a, .social button, .theme, .x {
  width: 2.75rem; height: 2.75rem; display: grid; place-items: center;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--fg);
}
.social svg, .theme svg { width: 1.25rem; height: 1.25rem; }
.whisper { min-height: 1rem; margin: 0.5rem 0 0; font-size: 0.75rem; color: var(--accent); }

.block { margin-top: 1.5rem; }
.block h2, .latest-head h2 {
  margin: 0 0 0.65rem; font-size: 0.75rem; font-weight: 500; letter-spacing: 0.22em; color: var(--muted);
}
.stack { display: flex; flex-direction: column; gap: 0.5rem; }
.latest-head { display: flex; align-items: baseline; justify-content: space-between; }
.latest-head a { font-size: 0.75rem; color: var(--accent); letter-spacing: 0; }

.row, .post {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 0.875rem; border: 1px solid var(--line); border-radius: 1.25rem; background: var(--surface);
  transition: border-color .18s ease, background-color .18s ease, transform .18s ease;
}
.post { align-items: flex-start; }
.row:active, .post:active { transform: scale(0.985); }
.mark {
  width: 2.75rem; height: 2.75rem; flex: none; display: grid; place-items: center;
  border-radius: 1rem; background: var(--chip);
}
.mark svg { width: 1.25rem; height: 1.25rem; }
.copy { min-width: 0; flex: 1; }
.copy strong, .post strong { display: block; font-size: 1rem; font-weight: 500; line-height: 1.35; overflow-wrap: anywhere; }
.copy span, .post em { display: block; margin-top: 0.15rem; font-style: normal; font-size: 0.875rem; line-height: 1.4; color: var(--muted); white-space: normal; overflow-wrap: anywhere; }
.post em { font-size: 0.75rem; margin-top: 0.25rem; }
.when { width: 3.5rem; flex: none; padding-top: 0.15rem; font-size: 0.75rem; line-height: 1.25; color: var(--muted); font-variant-numeric: tabular-nums; }
.arrow { width: 1rem; height: 1rem; flex: none; color: var(--muted); transition: transform .18s ease, color .18s ease; }
.empty { padding: 1.25rem 1rem; border: 1px dashed var(--line); border-radius: 1.25rem; color: var(--muted); font-size: 0.875rem; }
.empty a { color: var(--accent); }

.foot { margin-top: 2.5rem; text-align: center; }
.foot button { font-size: 0.75rem; color: var(--muted); }
.term {
  margin: 0;
  overflow-x: auto;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 0.2rem 0.35rem 0.45rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.75rem;
  line-height: 1.6;
  white-space: pre-wrap;
}
.term span { color: var(--muted); }
.caret { display: inline-block; width: 0.4rem; height: 0.75rem; margin-left: 0.15rem; background: var(--accent); vertical-align: middle; }

.snake { pointer-events: none; position: absolute; inset: -0.375rem; border-radius: 999px; opacity: 0; }
.snake.on { opacity: 1; animation: spin 1.7s linear 1; }
.snake i { position: absolute; border-radius: 999px; background: var(--accent); }
.snake i:nth-child(1) { top: 0; left: 50%; width: 0.5rem; height: 0.5rem; transform: translateX(-50%); }
.snake i:nth-child(2) { top: 0.25rem; left: 62%; width: 0.375rem; height: 0.375rem; opacity: 0.7; }
.snake i:nth-child(3) { top: 0.65rem; left: 74%; width: 0.25rem; height: 0.25rem; opacity: 0.4; }

.mask { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.mask .bg { position: absolute; inset: 0; background: color-mix(in srgb, var(--fg) 40%, transparent); }
.sheet {
  position: relative; z-index: 1; width: min(100%, 24rem);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 1.25rem 1.25rem 0 0; padding: 1.25rem 1.25rem max(1.25rem, env(safe-area-inset-bottom));
}
.sheet header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; }
.sheet h2 { margin: 0; font-size: 0.875rem; font-weight: 500; }
.sheet img { display: block; width: 100%; max-height: 68vh; object-fit: contain; border-radius: 1rem; margin: 0 auto; }
@media (min-width: 640px) {
  .mask { align-items: center; }
  .sheet { border-radius: 1.25rem; padding-bottom: 1.25rem; }
}

.rise { animation: rise .38s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(1turn); } }

.theme .sun { display: none; }
html[data-theme="dark"] .theme .moon { display: none; }
html[data-theme="dark"] .theme .sun { display: block; }

@media (hover: hover) and (pointer: fine) {
  .row:hover, .post:hover {
    transform: translateY(-1px);
    border-color: color-mix(in oklab, var(--accent) 46%, var(--line));
    background: color-mix(in oklab, var(--surface) 88%, var(--accent));
  }
  .row:hover .arrow, .post:hover .arrow { transform: translate(2px, -2px); color: var(--accent); }
  .post:hover strong { color: var(--accent); }
  .social a:hover, .social button:hover, .theme:hover {
    background: var(--accent); color: var(--accent-fg); border-color: var(--accent);
  }
}
@media (prefers-reduced-motion: reduce) {
  .row, .post, .arrow, .social a, .social button, .theme { transition: none; }
  .row:hover, .post:hover, .row:active, .post:active { transform: none; }
  .rise, .snake.on { animation: none; }
}

.name-dot {
  color: var(--accent);
  font: inherit;
  letter-spacing: inherit;
  line-height: inherit;
}

.mac-shade {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: max(1rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--fg) 28%, transparent);
}

.mac-win {
  width: min(100%, 26rem);
  border-radius: 12px;
  overflow: hidden;
  background: color-mix(in srgb, var(--surface) 94%, white);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--fg) 12%, transparent),
    0 28px 80px -24px rgb(0 0 0 / 45%);
}

.mac-win.wide { width: min(100%, 42rem); }
.mac-win.wide .mac-body { max-height: min(78vh, 48rem); overflow: auto; }
html[data-theme="dark"] .mac-win { background: #2c2a27; }

.mac-bar {
  position: relative;
  display: flex;
  align-items: center;
  height: 2.4rem;
  padding: 0 0.8rem;
  background: color-mix(in srgb, var(--chip) 70%, var(--surface));
  border-bottom: 1px solid color-mix(in srgb, var(--fg) 8%, transparent);
}

.mac-title {
  position: absolute;
  inset-inline: 0;
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 600;
  pointer-events: none;
}

.traffic { position: relative; z-index: 1; display: flex; gap: 0.5rem; }

.tl {
  display: block;
  position: relative;
  width: 0.78rem;
  height: 0.78rem;
  border: 0;
  border-radius: 999px;
  padding: 0;
  box-shadow: inset 0 0 0 0.5px rgb(0 0 0 / 18%);
}
.tl::after { content: ""; position: absolute; inset: -0.42rem; }
.tl-close { background: #ff5f57; }
.tl-min { background: #febc2e; }
.tl-zoom { background: #28c840; }

.mac-body { padding: 0.9rem 0.9rem 1rem; }
.mac-win.is-min { width: min(100%, 16rem); }
.mac-win.is-min .mac-body { display: none; }
.mac-body img {
  display: block;
  width: 100%;
  max-height: min(62vh, 28rem);
  object-fit: contain;
  border-radius: 8px;
}

.flag { display: block; width: 100%; height: 9.25rem; border-radius: 8px; }
.flag-note { margin: 0.75rem 0 0; text-align: center; color: var(--muted); font-size: 0.875rem; }

.about { display: grid; gap: 0.55rem; margin: 0; font-size: 0.875rem; }
.about div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--line);
}
.about dt { color: var(--muted); }
.about dd { margin: 0; }

.gate-page { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem 1rem; }
.field { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 0.75rem; }
.field span, .gate-h, .gate-note { color: var(--muted); font-size: 0.75rem; }
.gate-h { margin: 0.4rem 0 0.55rem; letter-spacing: 0.18em; }
.field input, .link-edit input, .link-edit select {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  font-size: 16px;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
}
.fields-2 { display: grid; gap: 0.75rem; }
@media (min-width: 720px) { .fields-2 { grid-template-columns: 1fr 1fr; } }
.link-edit { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; margin-bottom: 0.45rem; }
.btn {
  font: inherit;
  font-size: 16px;
  border-radius: 999px;
  border: 1px solid var(--fg);
  background: var(--fg);
  color: var(--bg);
  padding: 0.45rem 0.95rem;
}
.btn.ghost { background: transparent; color: var(--fg); margin-top: 0.75rem; }
.gate-msg { margin: 0 0 0.8rem; font-size: 0.875rem; }
.gate-msg.bad { color: #9f1239; }
html[data-theme="dark"] .gate-msg.bad { color: #fda4af; }
.gate-note { margin: 0.2rem 0 0.8rem; }
.gate-pass { margin-top: 1.25rem; }
.hp { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); }

