@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&display=swap');

:root{
  --ink:#0E0E0E;
  --paper:#F2F2F2;
  --red:#FF3B30;
  --rule:rgba(242,242,242,.2);
  --soft:rgba(242,242,242,.62);
  --mono:'Space Mono',ui-monospace,SFMono-Regular,Menlo,'PingFang SC','Microsoft YaHei',monospace;
}

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

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

body{
  margin:0;
  background:var(--ink);
  color:var(--paper);
  font-family:var(--mono);
  font-size:16px;
  line-height:1.75;
  letter-spacing:.015em;
  overflow-x:hidden;
}

body.lock{overflow:hidden}

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

h1,h2,h3{
  margin:0 0 .55em;
  font-weight:700;
  line-height:1.22;
  letter-spacing:-.02em;
}

p{margin:0 0 1em}
ul,ol{margin:0 0 1em;padding-left:1.15em}
img{display:block;max-width:100%;height:auto}
:focus-visible{outline:2px dashed var(--red);outline-offset:3px}

/* 顶栏 */
.top{
  position:sticky;
  top:0;
  z-index:40;
  background:var(--ink);
  border-bottom:1px solid var(--rule);
}

.top-brand{
  display:flex;
  align-items:center;
  gap:.6rem;
  padding:.35rem 1rem;
  border-bottom:1px dashed var(--rule);
}

.logo{display:inline-flex;align-items:center;min-height:42px}
.logo-mark{
  width:26px;
  height:26px;
  object-fit:cover;
  border:1px solid var(--rule);
  border-radius:4px;
  filter:grayscale(1);
}

.brand{
  display:inline-flex;
  align-items:center;
  min-height:42px;
  font-size:1rem;
  font-weight:700;
  letter-spacing:.2em;
  text-transform:none;
}

.brand-rule{
  flex:1;
  height:0;
  border-bottom:1px dotted var(--rule);
  align-self:center;
}

.top-bar{
  display:flex;
  align-items:center;
  gap:.7rem;
  padding:.2rem .8rem;
}

.menu-btn,
.contact,
.menu-close{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:42px;
  padding:.4rem .85rem;
  font:inherit;
  font-size:.82rem;
  letter-spacing:.22em;
  color:var(--paper);
  background:transparent;
  border:1px solid var(--rule);
  border-radius:4px;
  cursor:pointer;
  transition:color .2s,border-color .2s,background .2s;
}

.menu-btn:hover,
.contact:hover,
.menu-close:hover{
  color:var(--ink);
  background:var(--red);
  border-color:var(--red);
}

.bar-dots{
  flex:1;
  height:0;
  align-self:center;
  border-bottom:1px dotted var(--rule);
}

/* 全屏菜单 */
.menu{
  position:fixed;
  inset:0;
  z-index:60;
  display:flex;
  flex-direction:column;
  padding:1rem 1rem 1.4rem;
  background:var(--ink);
  background-image:radial-gradient(var(--rule) 1px,transparent 1px);
  background-size:18px 18px;
  opacity:0;
  visibility:hidden;
  transform:translateY(-1.2%);
  transition:opacity .28s ease,transform .28s ease,visibility .28s;
}

.menu.open{opacity:1;visibility:visible;transform:none}

.menu-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:1rem;
  padding-bottom:.9rem;
  border-bottom:1px solid var(--rule);
}

.menu-brand{font-weight:700;letter-spacing:.2em}

.menu-list{
  list-style:none;
  margin:auto 0;
  padding:1rem 0;
  display:grid;
  gap:.15rem;
}

.menu-list a{
  display:flex;
  align-items:baseline;
  gap:.85rem;
  min-height:50px;
  padding:.45rem .2rem;
  font-size:1.25rem;
  line-height:1.3;
  border-bottom:1px solid var(--rule);
  transition:color .2s,transform .2s;
}

.menu-list a:hover,
.menu-list a:focus-visible{
  color:var(--red);
  transform:translateX(4px);
}

.menu-list .idx{
  font-size:.7rem;
  letter-spacing:.1em;
  color:var(--red);
  min-width:1.6em;
}

.menu-foot{border-top:1px solid var(--rule);padding-top:.9rem}
.menu-foot a{
  display:inline-flex;
  align-items:center;
  min-height:42px;
  padding:.4rem .85rem;
  font-size:.82rem;
  letter-spacing:.22em;
  border:1px solid var(--rule);
  border-radius:4px;
}
.menu-foot a:hover{background:var(--red);color:var(--ink);border-color:var(--red)}

/* 主体 */
.wrap{display:block}
.doc{min-width:0;padding:0 1rem}

/* 首屏 */
.hero{
  position:relative;
  display:grid;
  place-items:center;
  min-height:45vh;
  padding:2.2rem 1rem;
  overflow:hidden;
  text-align:center;
  border-bottom:1px solid var(--rule);
  background-image:radial-gradient(var(--rule) 1px,transparent 1px);
  background-size:16px 16px;
}

.hero h1{
  position:relative;
  z-index:2;
  max-width:24ch;
  margin:0;
  font-size:clamp(1.85rem,7.2vw,4rem);
  letter-spacing:.04em;
  text-wrap:balance;
}

.hero h1::after{
  content:'';
  display:inline-block;
  width:.48em;
  height:.82em;
  margin-left:.12em;
  vertical-align:-.05em;
  background:var(--red);
  animation:blink 1.05s steps(1,end) infinite;
}

.collage{position:absolute;inset:0;z-index:1;pointer-events:none}

.collage-img{
  position:absolute;
  width:clamp(86px,22vw,168px);
  aspect-ratio:3/4;
  object-fit:cover;
  border:1px solid var(--rule);
  border-radius:4px;
  filter:grayscale(.5) contrast(1.06);
  opacity:.45;
}

.collage-a{
  left:-4%;
  bottom:-8%;
  transform:rotate(-5deg);
  animation:swapA 9s ease-in-out infinite;
}

.collage-b{
  right:-4%;
  top:-8%;
  transform:rotate(4deg);
  animation:swapB 9s ease-in-out infinite;
}

/* 正文分区 */
.doc > article{
  max-width:66ch;
  padding:2.1rem 0;
  border-bottom:1px solid var(--rule);
  scroll-margin-top:120px;
}

.doc > article h2{
  font-size:clamp(1.25rem,3.4vw,1.85rem);
  padding-left:.65rem;
  border-left:3px solid var(--red);
}

.doc > article h3{font-size:1.05rem;letter-spacing:.02em}

.doc a{
  color:var(--red);
  text-decoration:underline;
  text-underline-offset:3px;
}

.doc a:hover{background:var(--red);color:var(--ink)}

.doc ul li,
.doc ol li{margin-bottom:.35rem}

/* 侧栏 */
.rail{
  padding:1.6rem 1rem 2.4rem;
  border-top:1px solid var(--rule);
}

.rail-h{
  font-size:1rem;
  letter-spacing:.18em;
  margin-bottom:.35rem;
}

.subtitle{
  margin:0 0 1.1rem;
  font-size:.72rem;
  line-height:1.9;
  letter-spacing:.08em;
  color:var(--soft);
}

.rail-list{
  list-style:none;
  margin:0;
  padding:0;
  border-top:1px solid var(--rule);
}

.rail-list a{
  display:flex;
  align-items:center;
  min-height:40px;
  padding:.3rem 0;
  font-size:.82rem;
  border-bottom:1px dotted var(--rule);
  transition:color .2s,padding-left .2s;
}

.rail-list a:hover{color:var(--red);padding-left:.4rem}

/* 页脚 */
.bottom{
  margin-top:1rem;
  border-top:1px solid var(--rule);
}

.cta{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:.9rem;
  padding:3rem 1rem;
  text-align:center;
  background-image:radial-gradient(var(--rule) 1px,transparent 1px);
  background-size:16px 16px;
  border-bottom:1px solid var(--rule);
}

.cta-link{
  font-size:clamp(1.6rem,8vw,3.4rem);
  font-weight:700;
  line-height:1.1;
  letter-spacing:.05em;
  transition:color .2s;
}

.cta-link:hover{color:var(--red)}

.totop{
  display:inline-flex;
  align-items:center;
  min-height:44px;
  padding:.55rem 1.2rem;
  font-size:.78rem;
  letter-spacing:.22em;
  border:1px solid var(--paper);
  border-radius:4px;
}

.totop:hover{background:var(--paper);color:var(--ink)}

.legal{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  gap:.5rem 1rem;
  padding:.9rem 1rem;
  font-size:.76rem;
  letter-spacing:.1em;
  color:var(--soft);
}

.copy{margin:0}

.legal-links{display:flex;flex-wrap:wrap;gap:.2rem .9rem}

.legal-links a{
  display:inline-flex;
  align-items:center;
  min-height:40px;
  padding:.2rem 0;
}

.legal-links a:hover{color:var(--red)}

/* 动效 */
@keyframes blink{
  0%,49%{opacity:1}
  50%,100%{opacity:0}
}

@keyframes swapA{
  0%,100%{opacity:.2}
  50%{opacity:.55}
}

@keyframes swapB{
  0%,100%{opacity:.55}
  50%{opacity:.2}
}

@keyframes rise{
  from{opacity:0;transform:translateY(16px);letter-spacing:.2em}
  to{opacity:1;transform:none;letter-spacing:.04em}
}

@media (prefers-reduced-motion:no-preference){
  .hero h1{animation:rise .85s cubic-bezier(.2,.85,.25,1) both}

  html.js .doc > article{
    opacity:0;
    transform:translateY(18px);
    transition:opacity .6s ease,transform .6s ease;
  }

  html.js .doc > article.in{opacity:1;transform:none}
}

@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  .hero h1,
  .collage-a,
  .collage-b{animation:none}
  .collage-a,.collage-b{opacity:.45}
  .hero h1::after{animation:none}
}

/* 断点 */
@media (min-width:640px){
  .top-brand{padding:.45rem 1.4rem}
  .top-bar{padding:.25rem 1.2rem}
  .doc{padding:0 1.5rem}
  .rail{padding:1.6rem 1.5rem 2.6rem}
  .legal{padding:1rem 1.5rem}
}

@media (min-width:900px){
  .wrap{
    display:grid;
    grid-template-columns:minmax(0,1fr) 268px;
    gap:0 2.6rem;
    max-width:1180px;
    margin:0 auto;
    padding:0 1.6rem;
    align-items:start;
  }

  .doc{padding:0}

  .hero{margin-top:1.4rem;border:1px solid var(--rule);border-radius:4px;min-height:42vh}

  .rail{
    position:sticky;
    top:118px;
    margin-top:1.4rem;
    padding:0 0 2rem 1.3rem;
    border-top:0;
    border-left:1px solid var(--rule);
    max-height:calc(100vh - 140px);
    overflow:auto;
  }

  .bottom{margin-top:3rem}
}

@media (min-width:1100px){
  .hero h1{letter-spacing:.06em}
}

button[aria-expanded]{min-width:44px;min-height:44px}
