:root {
  color-scheme: dark;
  font: 16px/1.55 "Segoe UI", Arial, sans-serif;
  color: #f2ede2;
  background: #091724;
  --serif: Georgia, "Times New Roman", serif;
  --gold: #e9ca94;
  --line: #d3c5ae3d;
  --muted: #b3c1ca;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; min-height: 100svh; }
button, input, select, textarea { font: inherit; }
button, .primary, .secondary { touch-action: manipulation; }
button, a { cursor: pointer; }
a { color: inherit; }
button:disabled { opacity: .55; cursor: wait; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.1; }
h1 { font-size: clamp(2.4rem, 5vw, 4.2rem); margin: .2em 0 .58em; letter-spacing: -.045em; }
h2 { font-size: 2rem; margin: 0 0 .5em; } h3 { font-size: 1.5rem; }
.brand { color: var(--gold); letter-spacing: .14em; margin: 0 0 .6rem; font: italic 1.25rem var(--serif); }
label { display: block; margin: 0 0 1rem; font-size: .94rem; color: #ece6d9; }
label small { color: var(--muted); font-size: .83rem; }
input, textarea, select {
  display: block; width: 100%; min-height: 46px; margin-top: .35rem; padding: .68rem .8rem;
  color: #f7f2e9; background: #0b1a28; border: 1px solid #72869388; border-radius: 5px;
  font-size: 1rem;
}
textarea { resize: vertical; } input::placeholder, textarea::placeholder { color: #9aadb5; }
select { padding-right: 1.4rem; }
input[type=color] { cursor: pointer; padding: .36rem; }
.primary, .secondary, .quiet {
  display: inline-flex; align-items: center; justify-content: center; border-radius: 5px; font-size: .97rem;
  min-height: 44px; padding: .65rem 1.1rem; text-decoration: none;
}
.primary { color: #252017; background: #ebce9e; border: 1px solid #f8dfbb; font-weight: 600; }
.primary:hover { background: #f5dbb2; }
.secondary { color: #e7d6b7; background: #182935; border: 1px solid var(--line); }
.quiet { color: #ddd3c3; background: transparent; border: 0; text-decoration: underline; text-underline-offset: .25rem; padding-left: 0; }
.hint, .feedback, .gate-content > p:not(.brand) { color: var(--muted); }
.feedback { font-size: .94rem; overflow-wrap: anywhere; }
.feedback:empty { margin: 0; }
.gate, .book { background: radial-gradient(ellipse at 12% 17%, #1d3547 0, transparent 54%), #091724; }
.gate { display: grid; place-items: center; padding: 22px; }
.gate-card {
  width: min(860px, 100%); display: grid; grid-template-columns: .9fr 1.15fr;
  border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: #101f2d;
  box-shadow: 0 35px 120px #02091277;
}
.gate-content { padding: clamp(28px, 5vw, 58px); align-self: center; }
.gate-content h1 { font-size: clamp(2.35rem, 4.5vw, 3.25rem); }
.gate-content .primary { width: 100%; margin-top: .5rem; }
.night-window {
  position: relative; isolation: isolate; overflow: hidden; min-height: 450px; border-right: 1px solid var(--line);
  background: radial-gradient(ellipse at 60% 74%, #405064, transparent 60%), linear-gradient(155deg, #091423, #25394c 72%, #162a3b);
}
.night-window::before { content: ""; position: absolute; inset: 0; opacity: .58;
  background-image: radial-gradient(1px 1px at 21px 25px, #ffe6bd 98%, transparent), radial-gradient(1px 1px at 50px 13px, #c5e1ed 98%, transparent);
  background-size: 87px 97px, 139px 117px;
}
.night-window::after { content: ""; position: absolute; left: -45%; right: -28%; bottom: -23%; height: 53%; border-radius: 50%; transform: rotate(-11deg); background: linear-gradient(175deg, #1a3243, #081724); border-top: 1px solid #cadadf39; }
.twin { position: absolute; color: #ffe6b6; text-shadow: 0 0 18px #ffcf8a9c, 0 0 50px #e9ce99; line-height: 1; }
.twin.one { left: 30%; top: 31%; font-size: 46px; } .twin.two { left: 66%; top: 44%; font-size: 29px; }
.book { padding: 0 24px 60px; }
.book-nav, .desk { width: min(1020px, 100%); margin: auto; }
.book-nav { display: flex; justify-content: space-between; align-items: center; padding: 24px 0; border-bottom: 1px solid var(--line); gap: 15px; }
.sky-return { text-decoration: none; color: #e8d7b9; } .sky-return span { font-size: 1.5rem; margin-right: .35rem; vertical-align: -.08em; }
.desk { padding-top: clamp(30px, 6vw, 65px); }
.workspace { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(230px, .85fr); align-items: start; gap: clamp(24px, 5vw, 65px); }
fieldset { min-width: 0; border: 0; padding: 0 0 1.4rem; margin: 0 0 1.4rem; border-bottom: 1px solid var(--line); }
legend { padding: 0; margin-bottom: 1.15rem; font: 1.58rem var(--serif); color: #e8d3ad; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pair > label { min-width: 0; }
.closing, #invite-result { margin-top: 1.4rem; }
.story-block + .story-block { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: 1.3rem; }
.preview { --accent: #ddbd87; --star: #f1cc91; position: sticky; top: 30px; padding: 25px; min-width: 0; border-radius: 100px 100px 5px 5px;
  text-align: center; background: radial-gradient(ellipse at top, color-mix(in srgb, var(--accent) 18%, #142533), #0c1d2a 75%); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); }
.preview-star { font-size: 2.25rem; color: var(--star); text-shadow: 0 0 15px var(--star); }
.preview h2 { font-size: 1.65rem; margin: .25em 0; overflow-wrap: anywhere; }
.preview time, figcaption { color: #c8c4ba; font-size: .89rem; }
.preview figure { margin: 18px 0 0; }
.preview img { display: block; width: 100%; height: clamp(140px, 20vw, 245px); object-fit: contain; }
.preview figcaption { margin-top: .7rem; overflow-wrap: anywhere; }
.preview[data-layout=vintage] figure { padding: 9px; background: #e2d0ac; transform: rotate(-1deg); }
.preview[data-layout=vintage] figcaption { color: #453b2e; }
dialog { width: min(430px, calc(100% - 24px)); max-height: 90svh; padding: 0; border: 1px solid var(--line); border-radius: 7px; color: #f2ede2; background: #102230; }
dialog::backdrop { background: #020b13bf; }
.account-content { padding: 30px; } .close { position: absolute; top: 8px; right: 8px; height: 44px; width: 44px; background: transparent; color: var(--gold); border: 0; font-size: 1.6rem; }
#invite-panel { padding: 8px 0 18px; border-block: 1px solid var(--line); }
@media(max-width: 680px) {
  .gate-card { max-width: 450px; grid-template-columns: 1fr; }
  .night-window { min-height: 120px; border: 0; border-bottom: 1px solid var(--line); }
  .twin.one { font-size: 32px; } .twin.two { font-size: 22px; }
  .book { padding: 0 16px 40px; } .book-nav { padding: 16px 0; }
  .workspace { grid-template-columns: minmax(0,1fr); }
  .preview { position: static; grid-row: 1; border-radius: 5px; display: grid; grid-template-columns: 40px 1fr 62px; align-items: center; text-align: left; padding: 12px; column-gap: 12px; }
  .preview-star { grid-row: span 2; } .preview h2 { font-size: 1.22rem; } .preview time { grid-row: 2; grid-column: 2; }
  .preview figure { grid-column: 3; grid-row: 1 / span 2; margin: 0; } .preview img { height: 62px; }
  .preview figcaption { display: none; }
}
