/* Anamorph landing page — shared by the full prototype (index.html) and the landing-only page (landing.html).
   Options and their alternates are set as attributes on #landing:
   data-opt  which option (1, 2, 4 = "Option 3" typing, 5 = "Option 4" side by side, 7 = "Option 5" stacked)
   data-v    the layout shown: o1 (with data-lsize reg|big, data-lpos top|mid|bot, data-text corner|under|bottom) | link | outline | grey | typing | side | stack
   .pat      the glitch pattern running behind */
#landing{--lh:clamp(30px,5.2vw,76px);position:fixed;inset:0;z-index:100;background:#000;color:#f2f1ec;display:flex;align-items:center;justify-content:center;transition:opacity .4s ease;font-family:Areal,Arial,Helvetica,sans-serif;font-variation-settings:"MONO" 0,"DRKM" 1;-webkit-font-smoothing:antialiased}
#landing[hidden]{display:none!important}
#landing.out{opacity:0;pointer-events:none}
#landing button{font:inherit;color:inherit;background:none;border:0;padding:0;cursor:pointer}
#landing a{color:inherit}

/* the logo */
#landing .ln-box{position:relative;z-index:1;width:calc(var(--lh) * var(--ar0,9.4));display:flex;justify-content:center;padding:30px 0}
#landing.site .ln-box{cursor:pointer}
#landing .ln-logo{flex:none;display:block;height:var(--lh);width:calc(var(--lh) * var(--ar,9.4));overflow:visible}

/* the studio line: hidden unless the layout shows it */
#landing .ln-about{display:none;z-index:1;margin:0;font-size:11px;line-height:1.35}
#landing .ln-about a{text-decoration:none}#landing .ln-about a:hover{text-decoration:underline;text-underline-offset:2px}
#landing:is([data-v="o1"],[data-v="side"],[data-v="stack"]) .ln-about{display:block;position:absolute}

/* Option 1: logo size (data-lsize reg|big), logo position (data-lpos top|mid|bot) and text (data-text) are chosen separately.
   --lgh: the logo's resting height; --lgc: the height of its centre; --tb: room kept at the foot for the chosen text, so a logo at the bottom sits above it.
   "Under logo" text always sits just below whichever logo is shown */
#landing[data-v="o1"]{--lgh:var(--lh);--lgc:50%}
#landing[data-text="corner"]{--tb:calc(24px + 3 * 1.35 * var(--tfs,11px) + 28px)}
#landing[data-text="under"]{--tb:calc(52px + 2 * 1.4 * var(--tfs,12px) + 30px)}
#landing[data-text="bottom"]{--tb:calc(44px + 3 * 1.3 * var(--tfs,clamp(14px,1.35vw,19px)) + 36px)}
/* Big: the logo spans the page width × --bw (the Logo width slider), centred */
#landing[data-v="o1"][data-lsize="big"]{--bigw:calc((100vw - 56px) * var(--bw,1));--lgh:calc(var(--bigw) / var(--ar0,9.4))}
#landing[data-v="o1"][data-lpos="top"]{--lgc:calc(24px + var(--lgh) / 2)}
#landing[data-v="o1"][data-lpos="mid"][data-lsize="big"]{--lgc:46%}
#landing[data-v="o1"][data-lpos="bot"]{--lgc:calc(100% - var(--tb) - var(--lgh) / 2)}
#landing[data-v="o1"] .ln-box{position:absolute;top:var(--lgc);padding:0}
#landing[data-v="o1"][data-lsize="reg"] .ln-box{left:50%;transform:translate(-50%,-50%)}
#landing[data-v="o1"][data-lsize="big"] .ln-box{left:calc(50% - var(--bigw) / 2);right:auto;width:var(--bigw);transform:translateY(-50%);justify-content:flex-start}
/* text · Corner: small, bottom right */
#landing[data-text="corner"] .ln-about{right:28px;bottom:24px;max-width:var(--tw,330px);font-size:var(--tfs,11px)}
/* text · Under logo: centred below it */
#landing[data-text="under"] .ln-about{left:50%;top:calc(var(--lgc) + var(--lgh) / 2 + 52px);transform:translateX(-50%);width:var(--tw,min(560px,86vw));max-width:94vw;font-size:var(--tfs,12px);line-height:1.4}
/* text · Bottom: large, bottom left */
#landing[data-text="bottom"] .ln-about{left:28px;bottom:44px;max-width:var(--tw,min(620px,68vw));font-size:var(--tfs,clamp(14px,1.35vw,19px));line-height:1.3}

/* Option 4 · Side by side.
   The logo starts at 8% and grows only rightwards; it is sized so that even fully expanded (--armax, set by landing.js) it stops before 46% — the divide.
   Its top and the text's first line share one line, the pair centred on the page */
#landing[data-v="side"]{--lh:min(64px,calc(37vw / var(--armax,14.3)))}
#landing[data-v="side"] .ln-box{position:absolute;left:8%;top:calc(50% - var(--lh) / 2);transform:none;padding:0;justify-content:flex-start}
#landing[data-v="side"] .ln-about{left:52%;top:calc(50% - var(--lh) / 2 - .3em);transform:none;max-width:min(600px,40vw);font-size:clamp(13px,1.2vw,17px);line-height:1.4}
#landing[data-v="side"] .ln-about .ab2{display:block;margin-top:1.4em}
/* Option 5 · Stack: the logo a little above centre, the text centred beneath it in a block exactly as wide as the logo */
/* plain responsive rules: the logo scales fluidly with the window; the text keeps a readable size that steps up at the usual breakpoints,
   with its line length capped in characters; a fixed gap between them */
#landing[data-v="stack"]{--lh:clamp(30px,4.2vw,72px)}
#landing[data-v="stack"] .ln-box{position:absolute;left:50%;top:45%;transform:translate(-50%,-50%);padding:0}
#landing[data-v="stack"] .ln-about{left:50%;top:calc(45% + var(--lh) / 2 + 32px);transform:translateX(-50%);width:min(62ch,90vw);text-align:center;font-size:14px;line-height:1.35}
@media(min-width:1024px){#landing[data-v="stack"] .ln-about{font-size:15px}}
@media(min-width:1440px){#landing[data-v="stack"] .ln-about{font-size:17px;top:calc(45% + var(--lh) / 2 + 40px)}}
@media(max-width:600px){#landing[data-v="stack"]{--lh:calc(86vw / var(--ar0,9.4))}#landing[data-v="stack"] .ln-about{font-size:13px;top:calc(45% + var(--lh) / 2 + 24px)}}
/* Option 1 · size Big: the logo spans the page;
   when letters widen it keeps that width and its height gives a little instead */
#landing[data-lsize="big"] .ln-logo{width:100%;height:auto}
#landing[data-lsize="big"] .ln-logo path{stroke-width:6.4}


/* Option 2: readme.txt — a plain link under the logo's end, or a centred button (outlined or grey) that turns white on hover */
#landing .ln-rd{display:none;position:absolute;z-index:1;font-size:13px;line-height:1.2;white-space:nowrap;transition:background .12s,color .12s,box-shadow .12s}
#landing[data-v="link"] .ln-rd{display:block}#landing:is([data-v="outline"],[data-v="grey"]) .ln-rd{display:inline-flex}
#landing[data-v="link"] .ln-rd{right:0;top:calc(100% - 20px)}
#landing[data-v="link"] .ln-rd:hover{text-decoration:underline;text-underline-offset:3px}
#landing:is([data-v="outline"],[data-v="grey"]) .ln-rd{left:50%;transform:translateX(-50%);top:calc(100% + 22px);padding:6px 13px 5px 11px;border-radius:6px;display:inline-flex;align-items:center;gap:.45em}
#landing .ln-rd .ic{display:none}#landing .ln-rd .ic svg{display:block;width:1.15em;height:1.15em}
#landing:is([data-v="outline"],[data-v="grey"]) .ln-rd .ic{display:block}
#landing[data-v="outline"] .ln-rd{box-shadow:inset 0 0 0 1px #f2f1ec}
#landing[data-v="grey"] .ln-rd{background:#333}
#landing .ln-rd .ic+span{line-height:1}
#landing:is([data-v="outline"],[data-v="grey"]) .ln-rd:hover{background:#f2f1ec;color:#000;box-shadow:none}

/* the glitch pattern behind (the earlier "Option 3"), now a switch */
#landing .ln-field{position:absolute;inset:0;width:100%;height:100%;display:none;pointer-events:none;opacity:.55}
#landing.pat .ln-field{display:block}

/* Option 3 (typing): one README window typed out behind the logo */
#landing .ln-tw{display:none;position:absolute;z-index:0;left:2.5%;top:0;bottom:0;width:58%;padding-top:7vh;overflow:hidden;pointer-events:none;font-family:Areal,Menlo,monospace;font-variation-settings:"MONO" 100,"DRKM" 1;font-size:12px;line-height:1.55;color:#605F5C}
#landing[data-v="typing"] .ln-tw{display:block}
#landing .ln-tw .rl{display:grid;grid-template-columns:34px 1fr;gap:12px;white-space:pre-wrap;padding-right:18px}
#landing .ln-tw .rl b{font-weight:400;color:#353432;text-align:right}
#landing .ln-tw .ld{font-style:normal;color:#353432}
#landing .lt-cur{display:inline-block;width:.62em;height:1.15em;vertical-align:-.22em;background:currentColor;margin-left:1px;animation:ltBlink 1.06s steps(1) infinite}
#landing .ln-tw.typing .lt-cur{animation:none}
@keyframes ltBlink{50%{opacity:0}}

/* the README window (Option 2): drag by its bar, close, reopen */
#landing .ln-win{position:fixed;z-index:3;width:min(calc(100vw - 32px),max(560px,46vw),780px);height:min(76vh,820px);background:#0e0e0e;color:#e8e6df;display:flex;flex-direction:column;box-shadow:0 0 0 1px #1d1d1c,0 20px 60px rgba(0,0,0,.6);font-family:Areal,Menlo,monospace;font-variation-settings:"MONO" 100,"DRKM" 1;font-size:10px;line-height:1.6}
#landing .ln-win[hidden]{display:none}
#landing .lw-bar{flex:none;height:28px;display:flex;justify-content:flex-end;align-items:center;padding:0 8px;cursor:grab;touch-action:none}
#landing .ln-win.drag .lw-bar{cursor:grabbing}
#landing .lw-x{width:15px;height:15px;display:inline-flex;align-items:center;justify-content:center;box-shadow:inset 0 0 0 1px currentColor;color:#cfcdc6;font-size:9px;line-height:1;font-family:Areal,Arial,sans-serif}
#landing .lw-x:hover{background:#e8e6df;color:#0e0e0e}
#landing .lw-body{overflow:auto;padding:4px 0 16px;scrollbar-width:thin;scrollbar-color:#e8e6df transparent}
#landing .lw-body .rl{display:grid;grid-template-columns:30px 1fr;gap:10px;white-space:pre-wrap;padding-right:16px}
#landing .lw-body .rl b{font-weight:400;color:#55544f;text-align:right}
#landing .lw-body .rl>*{align-self:start} /* each cell keeps its own height, so the wrapped lines can be counted */
#landing .lw-body .ld{font-style:normal;color:#4a4945}
/* the window grows with the screen (text size with it, so lines keep a similar length) and stays centred; on phones it fills the width */
@media(min-width:1440px){#landing .ln-win{font-size:11px}}
@media(min-width:1800px){#landing .ln-win{font-size:12px}}
@media(max-width:600px){#landing .ln-win{width:calc(100vw - 24px);height:min(82vh,820px)}#landing .lw-body .rl{grid-template-columns:22px 1fr;gap:8px;padding-right:12px}}

/* review toolbar: options, and the alternates for the option shown. Tucked into the corner, with a clear gap under the large text set 44px from the bottom */
#landing .ln-opts{position:absolute;z-index:4;left:4px;bottom:4px;display:flex;align-items:stretch;background:rgba(14,14,13,.92);border:1px solid #3a3a37;font-size:10px;font-variation-settings:"MONO" 100,"DRKM" 1;line-height:1}
#landing .ln-opts .vl{color:#6f6e69;padding:4px 7px;display:flex;align-items:center}
#landing .ln-opts button{color:#b5b4ad;padding:4px 8px}#landing .ln-opts button:hover{color:#f2f1ec}
#landing .ln-opts button[aria-pressed=true]{background:#ecebe4;color:#0e0e0d}
#landing .ln-opts .ln-altb,#landing .ln-opts .ln-go{border-left:1px solid #3a3a37}
#landing .ln-opts .ln-altb[hidden],#landing .ln-opts[hidden]{display:none}
#landing .ln-alt{position:absolute;left:-1px;bottom:calc(100% + 6px);background:rgba(14,14,13,.96);border:1px solid #3a3a37;padding:8px 10px;display:flex;flex-direction:column;gap:6px;white-space:nowrap}
#landing .ln-alt[hidden]{display:none}
#landing .ln-alt .hvh{color:#f2f1ec;text-transform:uppercase;letter-spacing:.04em}
#landing .ln-alt .hvg{display:flex;align-items:center;gap:2px}
#landing .ln-alt .hvl{color:#6f6e69;width:8em}
/* size sliders (Option 1) */
#landing .ln-alt input[type=range]{width:150px;margin:0 6px 0 4px;accent-color:#ecebe4;cursor:pointer}
#landing .ln-alt .sv{color:#ecebe4;min-width:4.5em}
#landing .ln-alt .ln-rs{border:1px solid #3a3a37;margin-top:2px}

@media(max-width:760px){
  #landing:is([data-text="corner"],[data-text="bottom"]) .ln-about{left:16px;right:16px;bottom:54px;max-width:none}
  #landing[data-v="side"] .ln-box{left:50%;transform:translate(-50%,-140%)}
  #landing[data-v="side"] .ln-about{left:16px;right:16px;max-width:none;transform:none;top:55%}
  #landing .ln-tw{left:0;width:100%}}
