:root {
  --paper: #f2eedf;
  --paper-light: #fbf8ee;
  --ink: #11110f;
  --red: #e9472f;
  --line: rgba(17, 17, 15, 0.22);
  --mono: "DM Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  --sans: "Manrope", Arial, sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
}

* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); }
body { min-width: 320px; margin: 0; overflow-x: hidden; background: var(--paper); color: var(--ink); font-family: var(--sans); }
body.is-loading { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }

.skip-link { position: fixed; z-index: 1200; top: 10px; left: 10px; padding: 10px 14px; border: 1px solid var(--ink); background: white; transform: translateY(-200%); }
.skip-link:focus { transform: none; }

.loader { position: fixed; z-index: 999; inset: 0; display: grid; grid-template-rows: auto 1fr auto; padding: 24px 28px; color: var(--paper); background: var(--ink); transition: transform 700ms cubic-bezier(.75,0,.15,1), opacity 600ms ease; }
.loader.is-done { opacity: .5; pointer-events: none; transform: translateY(-105%); }
.loader__top, .loader__line { display: flex; align-items: center; justify-content: space-between; font: 500 11px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; }
.loader__faces { position: relative; min-height: 0; }
.face-orbit { position: absolute; aspect-ratio: 1; border-radius: 50%; box-shadow: 0 0 0 3px var(--ink), 0 0 0 4px rgba(242,238,223,.6); animation: face-float 2.3s ease-in-out infinite alternate; }
.face-orbit--one { width: clamp(120px,18vw,260px); top: 12%; left: 7%; }
.face-orbit--two { width: clamp(90px,13vw,190px); top: 48%; left: 36%; animation-delay: -.8s; }
.face-orbit--three { width: clamp(130px,21vw,310px); top: 8%; right: 8%; animation-delay: -.4s; }
.face-orbit--four { width: clamp(70px,10vw,145px); right: 29%; bottom: 4%; animation-delay: -1.4s; }
.face-orbit--five { width: clamp(60px,8vw,120px); top: 8%; left: 22%; animation-delay: -1.7s; }
.face-orbit--six { width: clamp(80px,11vw,155px); bottom: 4%; left: 3%; animation-delay: -2s; }
.loader__line { padding-top: 18px; border-top: 1px solid rgba(242,238,223,.35); }
.loader__line span:last-child { font-size: 42px; letter-spacing: -.08em; }
@keyframes face-float { from { transform: translate3d(0,-6px,0) rotate(-1deg); } to { transform: translate3d(0,9px,0) rotate(2deg); } }

.text-button { padding: 0; border: 0; background: transparent; cursor: pointer; font: inherit; letter-spacing: inherit; text-transform: uppercase; }
.text-button--light { color: var(--paper); border-bottom: 1px solid currentColor; }

.site-header { position: absolute; z-index: 10; top: 0; right: 0; left: 0; min-height: 82px; display: flex; align-items: center; padding: 0 28px; border-bottom: 1px solid var(--line); }
.brand { font: 400 clamp(23px,2.2vw,32px)/1 var(--serif); letter-spacing: -.045em; }
.brand span { margin-left: 3px; font: 400 8px/1 var(--mono); vertical-align: top; }
.eyebrow { margin: 0; font: 500 10px/1.2 var(--mono); letter-spacing: .17em; text-transform: uppercase; }

.launch-page { min-height: 100svh; display: grid; grid-template-columns: minmax(340px,.78fr) minmax(520px,1.22fr); gap: clamp(36px,6vw,110px); align-items: center; padding: 116px 28px 34px; }
.launch-intro { min-width: 0; }
.launch-intro h1 { margin: clamp(70px,14vh,150px) 0 42px; font: 400 clamp(78px,10.2vw,166px)/.72 var(--serif); letter-spacing: -.07em; }
.launch-intro h1 em { color: var(--red); font-weight: 400; }
.launch-sequence { max-width: 30ch; margin: 0; font: 500 12px/1.55 var(--mono); }

.person-generator { width: min(100%,720px); justify-self: end; }
.generator-preview { position: relative; width: 100%; aspect-ratio: 1; overflow: hidden; border: 1px solid var(--ink); background: var(--ink); }
.generator-preview__image { width: 100%; height: 100%; transition: background-position .35s ease; }
.regenerate-button { position: absolute; right: 18px; bottom: 18px; padding: 13px 16px; border: 1px solid white; border-radius: 999px; color: white; background: rgba(0,0,0,.52); backdrop-filter: blur(10px); cursor: pointer; font: 500 9px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.regenerate-button:disabled { opacity: .45; cursor: wait; }
.regenerate-button span { display: inline-block; margin-right: 5px; font-size: 16px; vertical-align: -1px; }

.launch-form { display: grid; grid-template-columns: minmax(0,1fr) minmax(190px,.38fr); align-items: end; gap: 18px; padding-top: 20px; }
.field { display: block; }
.field > span:first-child { display: block; margin-bottom: 8px; font: 500 9px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.field input { width: 100%; padding: 13px 0 12px; border: 0; border-bottom: 1px solid var(--ink); border-radius: 0; outline: none; color: var(--ink); background: transparent; font: 400 clamp(28px,3.2vw,46px)/1 var(--serif); }
.field input:focus { border-bottom-width: 2px; }
.field input[readonly] { opacity: .58; }
.launch-button { width: 100%; min-height: 58px; display: flex; align-items: center; justify-content: space-between; padding: 18px 19px; border: 1px solid var(--ink); color: var(--paper); background: var(--ink); cursor: pointer; transition: background .2s, color .2s; font: 500 10px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.launch-button:hover:not(:disabled) { color: var(--ink); background: var(--red); }
.launch-button:disabled { opacity: .32; cursor: not-allowed; }
.form-note { grid-column: 1 / -1; margin: -4px 0 0; color: #7d2418; font: 400 9px/1.45 var(--mono); }

.portrait { background-image: url("/assets/fictional-people-grid.png"); background-repeat: no-repeat; background-position: var(--portrait-x,0%) var(--portrait-y,0%); background-size: 400% 400%; }
.portrait--0 { --portrait-x:0%; --portrait-y:0%; }.portrait--1 { --portrait-x:33.333%; --portrait-y:0%; }.portrait--2 { --portrait-x:66.666%; --portrait-y:0%; }.portrait--3 { --portrait-x:100%; --portrait-y:0%; }
.portrait--4 { --portrait-x:0%; --portrait-y:33.333%; }.portrait--5 { --portrait-x:33.333%; --portrait-y:33.333%; }.portrait--6 { --portrait-x:66.666%; --portrait-y:33.333%; }.portrait--7 { --portrait-x:100%; --portrait-y:33.333%; }
.portrait--8 { --portrait-x:0%; --portrait-y:66.666%; }.portrait--9 { --portrait-x:33.333%; --portrait-y:66.666%; }.portrait--10 { --portrait-x:66.666%; --portrait-y:66.666%; }.portrait--11 { --portrait-x:100%; --portrait-y:66.666%; }
.portrait--12 { --portrait-x:0%; --portrait-y:100%; }.portrait--13 { --portrait-x:33.333%; --portrait-y:100%; }.portrait--14 { --portrait-x:66.666%; --portrait-y:100%; }.portrait--15 { --portrait-x:100%; --portrait-y:100%; }

.toast-region { position: fixed; z-index: 1100; right: 18px; bottom: 18px; display: grid; gap: 8px; pointer-events: none; }
.toast { max-width: min(430px,calc(100vw - 36px)); padding: 14px 17px; border: 1px solid var(--ink); color: var(--ink); background: var(--paper-light); box-shadow: 5px 5px 0 var(--ink); opacity: 0; transform: translateY(10px); transition: .25s ease; font: 500 10px/1.45 var(--mono); }
.toast.is-visible { opacity: 1; transform: none; }
.toast--error { background: #ffb2a5; }
.toast--success { background: #b9e9ad; }
.toast--warning { background: #ffe87c; }

.admin-body { min-height: 100vh; color: var(--paper); background: var(--ink); }
.admin-header { min-height: 80px; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; border-bottom: 1px solid rgba(242,238,223,.25); }
.admin-header > a:last-child { font: 500 9px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.admin-main { min-height: calc(100vh - 80px); display: grid; grid-template-columns: .85fr 1.15fr; }
.admin-intro { padding: 60px 7vw 60px 28px; border-right: 1px solid rgba(242,238,223,.25); }
.admin-intro h1 { margin: clamp(80px,14vh,150px) 0 45px; font: 400 clamp(58px,7.5vw,118px)/.78 var(--serif); letter-spacing: -.055em; }
.admin-intro h1 em { color: var(--red); font-weight: 400; }
.admin-intro > p:last-child { max-width: 50ch; font: 400 11px/1.7 var(--mono); }
.admin-panel { align-self: start; margin: 60px 28px; border: 1px solid rgba(242,238,223,.5); }
.admin-panel__header { display: flex; align-items: center; justify-content: space-between; padding: 20px; border-bottom: 1px solid rgba(242,238,223,.5); }
.admin-panel__header h2 { margin: 0; font: 400 36px/1 var(--serif); }
.live-badge { display: flex; align-items: center; gap: 8px; font: 500 9px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: #5fc566; box-shadow: 0 0 0 5px rgba(95,197,102,.15); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 2px rgba(95,197,102,.08); } }
.current-config { margin: 0; }
.current-config div { display: grid; grid-template-columns: 150px minmax(0,1fr); padding: 15px 20px; border-bottom: 1px solid rgba(242,238,223,.25); font: 400 10px/1.4 var(--mono); }
.current-config dt { text-transform: uppercase; }
.current-config dd { min-width: 0; margin: 0; overflow: hidden; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.admin-form { padding: 28px 20px 22px; }
.admin-form .field { margin-bottom: 22px; }
.field--dark input { color: var(--paper); border-color: rgba(242,238,223,.5); font-size: clamp(20px,2.6vw,34px); }
.field--dark input::placeholder { color: rgba(242,238,223,.3); }
.check-field { display: flex; gap: 11px; align-items: start; margin: 0 0 22px; cursor: pointer; font: 400 10px/1.5 var(--mono); }
.check-field input { width: 15px; height: 15px; margin: 0; accent-color: var(--red); }
.check-field--dark { color: rgba(242,238,223,.8); }
.launch-button--light { color: var(--ink); border-color: var(--paper); background: var(--paper); }
.launch-button--light:hover:not(:disabled) { border-color: var(--red); background: var(--red); }
.form-note--dark { margin: 12px 0 0; color: rgba(242,238,223,.55); }
.admin-aside { grid-column: 2; display: grid; grid-template-columns: 150px 1fr; gap: 20px; margin: 0 28px 55px; padding-top: 15px; border-top: 1px solid rgba(242,238,223,.3); font: 400 10px/1.6 var(--mono); }
.admin-aside span { text-transform: uppercase; }
.admin-aside p { max-width: 68ch; margin: 0; }

@media (max-width: 1000px) {
  .launch-page { grid-template-columns: minmax(240px,.7fr) minmax(420px,1.3fr); gap: 34px; }
  .launch-intro h1 { font-size: clamp(66px,10vw,110px); }
  .admin-main { grid-template-columns: 1fr; }
  .admin-intro { border-right: 0; border-bottom: 1px solid rgba(242,238,223,.25); }
  .admin-panel, .admin-aside { grid-column: 1; }
}

@media (max-width: 760px) {
  .site-header { min-height: 70px; padding: 0 16px; }
  .launch-page { display: block; padding: 104px 16px 30px; }
  .launch-intro h1 { margin: 52px 0 25px; font-size: clamp(72px,23vw,118px); }
  .launch-sequence { margin-bottom: 46px; }
  .person-generator { width: 100%; }
  .launch-form { grid-template-columns: 1fr; gap: 16px; }
  .launch-button { min-height: 56px; }
  .form-note { grid-column: 1; }
  .loader { padding: 20px 16px; }
  .face-orbit--two { left: 46%; }
  .face-orbit--four { right: 13%; }
  .admin-header, .admin-intro { padding-right: 16px; padding-left: 16px; }
  .admin-panel { margin: 30px 16px; }
  .current-config div { grid-template-columns: 100px minmax(0,1fr); }
  .admin-aside { grid-template-columns: 1fr; margin: 0 16px 40px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
