:root {
  --space-ink:#14162e;
  --star-white:#fff8ed;
  --star-muted:#d0cce5;
  --light-glass:rgba(247,245,255,.92);
  --glass-line:rgba(221,225,255,.29);
  --glass-shadow:0 22px 70px #090c2566;
  --starlight:#bfadff;
  --star-gold:#ffe8b8;
  --ink:#242740;
  --paper:#edeaf7;
  --sheet:#faf8ff;
  --muted:#575471;
  --rule:#c9c5de;
  --accent:#514187;
  --accent-deep:#40306f;
  --accent-wash:#eae4fa;
  --lavender:#ebe3fa;
  --moss:#365d61;
  --moss-wash:#e1f2ef;
  --cotton:#edeaf8;
  --pear:#f8eed9;
  --focus:#296fbc;
}

html { color-scheme:light; }
body { background:#12152c; color:var(--ink); isolation:isolate; }
body::before { content:none; }
.sky { position:fixed; inset:0; z-index:-1; overflow:hidden; pointer-events:none;
  background:radial-gradient(ellipse at 85% 100%,#32274f 0%,transparent 58%),linear-gradient(135deg,#10162d,#171a3c 54%,#28203f); }
.sky::before {
  content:""; position:absolute; inset:-15%;
  background:radial-gradient(ellipse at 17% 42%,#2594ac57 0%,transparent 35%),
             radial-gradient(ellipse at 80% 21%,#7653c971 0%,transparent 36%),
             radial-gradient(ellipse at 68% 80%,#c767a150 0%,transparent 30%),
             radial-gradient(ellipse at 37% 12%,#c196503b 0%,transparent 22%);
  animation:nebula-drift 13s ease-in-out infinite alternate;
}
.sky i,.sky b { position:absolute; inset:-34px; display:block; opacity:.65; }
.sky i {
  background-image:radial-gradient(circle at 13px 21px,#fffadf 0 1px,transparent 1.6px),
    radial-gradient(circle at 72px 59px,#cce2ff 0 .8px,transparent 1.4px);
  background-size:113px 107px,161px 151px;
  animation:star-drift 9s ease-in-out infinite alternate;
}
.sky b {
  background-image:radial-gradient(circle at 38px 32px,#fff 0 .7px,transparent 1.3px),
    radial-gradient(circle at 91px 99px,#f6b8ed 0 .8px,transparent 1.4px);
  background-size:181px 193px,231px 209px;
  animation:star-drift 14s ease-in-out -7s infinite alternate-reverse;
}
@keyframes nebula-drift {
  from {transform:translate3d(-7%,-3%,0) scale(1.02);}
  to {transform:translate3d(7%,5%,0) scale(1.1);}
}
@keyframes star-drift {
  from {transform:translate3d(0,0,0);opacity:.36;}
  to {transform:translate3d(-28px,24px,0);opacity:.83;}
}
.sky-meteor {
  position:absolute; top:19%; left:68%; width:clamp(44px,9vw,120px); height:2px; opacity:0;
  border-radius:50%; background:linear-gradient(90deg,transparent,#b4d2ff9c,#fff1d2);
  filter:drop-shadow(0 0 5px #b7a2ff); animation:sky-streak 12s ease-out -1s infinite;
}
@keyframes sky-streak {
  0%,100% { opacity:0; transform:translate3d(-90px,-65px,0) rotate(32deg); }
  12% { opacity:.85; }
  23%,99% { opacity:0; transform:translate3d(145px,84px,0) rotate(32deg); }
}

.site-header { background:#15192b69; border-bottom:1px solid var(--glass-line); backdrop-filter:blur(16px); padding-top:env(safe-area-inset-top); }
.header-row { display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:.5rem 1.15rem; border:0; }
.brand.masthead,.header-row nav a,.footer .brand { color:var(--star-white); }
.brand-note { color:var(--star-muted); font-size:.88rem; min-width:0; }
.header-row nav { gap:clamp(.62rem,3vw,1.35rem); white-space:nowrap; }
.header-row nav a { min-height:44px; }
.footer { border-color:var(--glass-line); color:var(--star-muted); }
.cover {
  margin-block:clamp(1.4rem,4vw,3rem); padding:clamp(1.1rem,4vw,3.1rem);
  border:1px solid var(--glass-line); border-radius:clamp(22px,4vw,36px);
  background:linear-gradient(150deg,#dceaff18,#6b5bae1c 55%,#f091b91a);
  box-shadow:inset 0 1px #fff3,var(--glass-shadow); backdrop-filter:blur(14px);
}
.cover h1 { color:var(--star-white); font-size:clamp(2.45rem,8.2vw,5.15rem); text-shadow:0 6px 35px #0b0b34aa; }
.cover .hero-copy p { color:var(--star-muted); max-width:min(100%,27em); }
.how { color:var(--star-white); border-color:var(--glass-line); }
.how > p { color:var(--star-muted); }
.cover a:focus-visible,.site-header a:focus-visible,.footer a:focus-visible,.page > .back:focus-visible,.report .portrait-report > .back:focus-visible {
  outline-color:var(--star-gold);
}

.mail-stage { width:min(100%,470px); }
.mail-stage .letter-stage {
  width:100%; max-width:460px; aspect-ratio:1.14; margin:.25rem auto 1.75rem;
  perspective:900px;
}
.mail-stage .envelope-body {
  --stock:#8baee4; --fold:#d7dcf8; --lining:#7561a8;
  width:98%; height:63%;
  background:radial-gradient(ellipse at 6% 12%,#95e7f3a8,transparent 69%),
    radial-gradient(ellipse at 96% 90%,#f1b3eaaa,transparent 66%),linear-gradient(136deg,#7d9bcea6,#7765bab8);
  border:1px solid #e9e6ffae; border-radius:15px 15px 22px 22px;
  transform:rotate(-2deg) perspective(760px) rotateX(6deg);
  box-shadow:inset 0 2px 3px #fff4ff8a,inset 0 -3px 8px #514177bc,
    0 5px 0 #6666a580,0 20px 35px #090c2d99,0 0 54px #8daaf64a;
}
.mail-stage .letter-popped .envelope-body { transform:rotate(0deg); }
.mail-stage .envelope-pocket {
  background:linear-gradient(34deg,#7192c4e6,#aec9f6c9 48.8%,#e8ecffe6 49.4%,#ad94d9c9 50.4%,#c59fd1ed);
  backdrop-filter:blur(11px);
  box-shadow:inset 0 -2px 0 #e9dcff88;
}
.mail-stage .envelope-pocket::after { background:linear-gradient(114deg,#93d7e8bc,#ada0dba6 50%,#e5acc9c9); }
.mail-stage .envelope-flap {
  border-radius:14px 14px 0 0;
  background:radial-gradient(ellipse at 31% -7%,#fcfcffe8,transparent 67%),
    linear-gradient(145deg,#c0ebf7,#b5b5ec 54%,#ae7fb8);
  clip-path:polygon(0 0,100% 0,55% 91%,52% 97%,48% 97%,45% 91%);
}
.mail-stage .letter-popped .envelope-flap { background:linear-gradient(146deg,#ccbdf1,#c7e4f4 49%,#8b70b4); }
.mail-stage .letter-insert { background:#e4e4ffef; border-color:#f3ecffbb; }
.mail-stage .envelope-seal {
  display:grid; top:48%; left:44%; width:12%; color:#fdf3d9;
  background:radial-gradient(circle at 32% 22%,#cd9eca,#886ab2 59%,#675297);
  border:1px solid #ead9f2; border-radius:50%;
  box-shadow:0 4px 10px #39326392,inset 0 0 0 3px #ba99ca8a,inset 0 0 0 4px #edd6e9a1;
}
.mail-stage .mail-cards { width:min(91%,365px); }
.envelope-label { position:absolute; inset:auto 0 -1.65rem; color:var(--star-white); text-align:center; font-size:.89rem; font-weight:650; }
.envelope-label span { margin-left:.35rem; color:var(--star-gold); }
.letter-popped .envelope-label span { display:inline-block; transform:rotate(180deg); }
.mail-card a {
  --card-face:linear-gradient(140deg,#d2f4faee,#d5e5ffda);
  background:var(--card-face); border:1px solid #f7f7ffbf; color:var(--ink); backdrop-filter:blur(12px);
  box-shadow:inset 0 1px #fff9,0 3px #8f85c598,0 9px 23px #16133253;
  border-radius:12px; min-height:52px;
}
.mail-card:nth-child(2) a { --card-face:linear-gradient(140deg,#efdcf9ef,#d7ccffd9); }
.mail-card:nth-child(3) a { --card-face:linear-gradient(140deg,#ffe6d9eb,#f2cceadf); }
.mail-card a:focus-visible { outline-color:var(--star-gold); }

.page > .title,.report > .stack-lg > .title,.page > .back,.portrait-report > .back { color:var(--star-white); }
.title .back,.page > .back,.portrait-report > .back { color:var(--star-gold); }
.page > .title p,.report > .stack-lg > .title p { color:var(--star-muted); }
.sheet { background:var(--light-glass); border:1px solid #fbfaff7a; box-shadow:0 12px 30px #0b0c292a; backdrop-filter:blur(12px); }
.tint { background:#f1e5f6ed; }
.score-band { background:var(--light-glass); border-radius:18px; }
.report > .stack-lg > .score-note,.report > .stack-lg > .stack:not(.portrait-report) { color:var(--star-white); }
.report > .stack-lg > #dimensions .fine { color:var(--star-muted); }
.report > .stack-lg > #dimensions .comparison summary { color:var(--star-gold); }
.report > .stack-lg > #dimensions .comparison .answer-pair { color:var(--ink); }
.report > .stack-lg > #dimensions .comparison .answer-pair .fine { color:var(--muted); }
.indexes .jump { color:var(--star-gold); }
.choice:has(:checked) { background:#eae3fb; }
.question-scene {
  aspect-ratio:16 / 9; max-height:280px; height:auto; object-fit:cover; object-position:center;
  background:var(--cotton); border:1px solid var(--rule);
}
.portrait-report { gap:0; }
.portrait-cover {
  color:var(--star-white); background:radial-gradient(ellipse at 90% 13%,#8e6ac762,transparent 58%),
    radial-gradient(ellipse at 1% 100%,#417e9a55,transparent 56%),linear-gradient(151deg,#222641f0,#1a1b32f0);
  border:1px solid var(--glass-line); border-radius:25px;
  box-shadow:inset 0 1px #faf0ff38,var(--glass-shadow); backdrop-filter:blur(18px);
}
.portrait-cover h1 { color:var(--star-white); margin:.55rem 0 .85rem; font-size:clamp(1.85rem,5vw,3.4rem); }
.portrait-cover h2 { color:#eacffb; }
.portrait-owner,.portrait-cover .eng { color:var(--star-muted); font-style:normal; }
.portrait-cover blockquote { color:var(--star-gold); }
.portrait-cover img {
  mix-blend-mode:normal; aspect-ratio:1; height:auto; object-fit:contain; border-radius:16px;
  border:1px solid #f3e4ff71; background:#f7eddb; box-shadow:0 9px 28px #0d10294d;
}
.portrait-cover .tag { color:#f0e5ff; background:#dfc7ff20; border:1px solid #e4d4ff49; font-size:.8rem; }
.report-seal { border:1px solid #e3dcff66; border-radius:10px; background:linear-gradient(105deg,#d2bbf4,#c7eafa); color:#262341; }
.report-seal:focus-visible::before { outline-color:var(--star-gold); }
.report-paper { margin:.55rem 0 0; background:var(--light-glass); border-radius:20px; }
.report-paper > .sheet,.report-paper > .letter-chapter,.report-paper > .stack {
  border:1px solid #fff8; border-radius:16px; padding:clamp(.88rem,3vw,1.35rem);
  background:#ffffff96; box-shadow:none;
}
.axis-figure { border-radius:12px; background:#edebf8; }
.axis-track { background:var(--axis-color,#a98ece); }
.axis-row:nth-child(2) { --axis-color:#b6936f; }
.axis-row:nth-child(3) { --axis-color:#7b9d9f; }
.axis-row:nth-child(4) { --axis-color:#b3869d; }
.axis-marker { background:#242744; }
.history-note { background:#f1e5f7; }

@media(max-width:650px) {
  .header-row { grid-template-columns:minmax(0,1fr) auto; gap:0 .55rem; padding:.3rem 0 .65rem; }
  .brand-note { grid-area:2/1/3/-1; font-size:.8rem; }
  .header-row nav { grid-area:1/2/2/3; }
}
@media(max-width:600px) {
  .sky b { display:none; }
  .sky i { background-size:149px 157px,201px 191px; }
  .site-header,.cover,.sheet,.portrait-cover { backdrop-filter:none; }
  .portrait-cover { column-gap:.7rem; }
  .cover { padding-bottom:1.8rem; }
}
@media(max-width:480px) {
  .page,.report { padding-block:.85rem 2rem; }
  .button { max-inline-size:100%; overflow-wrap:anywhere; }
  .header-row .brand { display:inline-flex; align-items:center; min-height:44px; }
  .report .portrait-cover { padding:1rem; gap:.65rem .85rem; }
  .portrait-cover:has(img) { grid-template-columns:minmax(0,1fr) clamp(4rem,23vw,6rem); }
  .portrait-cover > img { grid-row:1; }
  .portrait-cover h1 { font-size:clamp(1.35rem,6.25vw,1.85rem); margin:.3rem 0 .55rem; }
  .portrait-cover blockquote { margin:.45rem 0 0; }
  .portrait-description { grid-column:1 / -1; }
  .report-seal { margin-top:.25rem; }
  .report-paper { padding:.55rem; gap:.8rem; }
  .report-paper > .sheet,.report-paper > .letter-chapter,.report-paper > .stack { padding:.8rem; }
  .axis-figure { padding:.65rem; }
  .axis-scale { grid-template-columns:repeat(2,minmax(0,1fr)); gap:.25rem .5rem; }
  .axis-track { grid-area:1 / 1 / 2 / -1; margin:.45rem 7px 0; }
  form[data-form="question"] { padding:.9rem; gap:.8rem; }
  form[data-form="question"] .actions { display:grid; grid-auto-columns:minmax(0,1fr); grid-auto-flow:column; gap:.5rem; }
  form[data-form="question"] .actions .button { margin:0; min-width:0; padding-inline:.3rem; }
  .question .choice { gap:.55rem; }
  .question .choice > span { min-width:0; overflow-wrap:anywhere; }
  .footer { flex-wrap:wrap; }
}
@media(prefers-reduced-motion:reduce) {
  .sky::before,.sky i,.sky b,.sky-meteor { animation:none; }
}

.sky { translate:0 var(--far-shift,0px); bottom:-42px; }
.depth-halo {
  pointer-events:none;
  position:absolute;
  inset:-8% -5%;
  z-index:-1;
  border-radius:inherit;
  background:radial-gradient(ellipse at 76% 55%,#a88dff35,transparent 57%),
             radial-gradient(ellipse at 28% 88%,#6cdaed20,transparent 47%);
  translate:0 var(--mid-shift,0px);
}
.mail-stage { translate:0 var(--near-shift,0px); }
.mail-stage .envelope-body {
  translate:0 0;
  transition:transform 280ms cubic-bezier(.17,.7,.23,1),translate 260ms cubic-bezier(.17,.7,.23,1);
}
.mail-stage .magnet-active .envelope-body { translate:var(--magnet-x,0px) var(--magnet-y,0px); }
.question .choice {
  position:relative;
  isolation:isolate;
  min-height:50px;
  gap:.75rem;
  z-index:0;
  border:1px solid transparent;
  border-radius:13px;
  background:none;
  box-shadow:none;
  -webkit-tap-highlight-color:transparent;
}
.question .choice::before,.question .choice::after {
  content:"";
  position:absolute;
  inset:0;
  border-radius:inherit;
  pointer-events:none;
  z-index:-1;
  transition:translate 240ms cubic-bezier(.17,.7,.23,1),scale 220ms cubic-bezier(.17,.7,.23,1),opacity 200ms ease-out;
}
.question .choice::before {
  border:1px solid #b9afd7;
  background:linear-gradient(150deg,#ffffffdf,#e5ddf8c4 63%,#d7eaf2bf);
  box-shadow:inset 0 1px 0 #fff,inset 0 -3px 6px #6e569018,0 3px 0 #bbb0d2,0 7px 15px #56477832;
}
.question .choice::after {
  background:radial-gradient(90px circle at var(--answer-light-x,25%) var(--answer-light-y,35%),#fffdf4ee,transparent);
  opacity:.3;
}
.question .choice.magnet-active::before,.question .choice.magnet-active::after {
  translate:var(--magnet-x,0px) var(--magnet-y,0px);
}
.question .choice.magnet-active::after { opacity:.9; }
.question .choice:active::before,.question .choice:active::after { scale:.98; }
.question .choice:active::before { border-color:#7e60b6; box-shadow:inset 0 1px 4px #7760a364,0 1px 0 #a697bf; }
.question .choice:has(:checked)::before { border:2px solid #60469b; background:linear-gradient(150deg,#f2ebff,#d7c7f2); }
.question .choice:has(:checked) { background:none; box-shadow:none; }
.answer-check { visibility:hidden; margin-inline-start:auto; font-weight:700; color:var(--accent-deep); }
.question .choice:has(:checked) .answer-check { visibility:visible; }
.question legend:focus { outline:none; }
@media(prefers-reduced-motion:reduce) {
  .sky,.depth-halo,.mail-stage,.mail-stage .magnet-active .envelope-body,
  .question .choice.magnet-active::before,.question .choice.magnet-active::after { translate:none; }
}
