/* What a visitor sees before signing in, all inside #authGate: the loading splash (#authSplash), the first page
   (#landing, drawn by landing.js) and the sign-in window (#authSignin). Look: the owner's renders
   docs/design/landing/ (first page) and docs/design/inner/01-auth-* (sign-in). Colours, fonts and components come from
   wordbeat.css; the red letter uses its .prefix .orp .suffix rules. Phone layout at 760 px and below. */
.auth-gate{min-height:100vh;min-height:100dvh;background:var(--bg)}

/* Loading splash: only the mark; "Проверяем вход…" stays for screen readers in the status line. */
.auth-splash{min-height:100vh;min-height:100dvh;display:grid;place-items:center;align-content:center;gap:16px;padding:24px}
.auth-splash-mark{width:44px;height:50px;color:var(--red)}
.auth-noscript{margin:0;color:var(--muted)}

/* Status line of the gate (the session ended, signed out, code sent again): floating at the bottom, hidden when empty;
   taps go through it. */
.auth-gate>.status{position:fixed;left:50%;bottom:calc(16px + env(safe-area-inset-bottom));transform:translateX(-50%);z-index:30;width:max-content;max-width:calc(100% - 32px);margin:0;padding:10px 14px;border:1px solid var(--line);border-radius:var(--radius-button);background:var(--field);box-shadow:0 10px 30px rgb(0 0 0 / .5);pointer-events:none}
.auth-gate>.status:empty{display:none}
.auth-gate[data-mode=loading]>.status{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0;box-shadow:none}

/* ---------- First page ---------- */
.landing{--gutter:max(20px,min(5.5vw,80px));min-height:100vh;min-height:100dvh;color:var(--text)}
.landing-row{width:100%;max-width:calc(1280px + 2 * var(--gutter));margin-inline:auto;padding-inline:var(--gutter)}
.landing h1,.landing h2,.landing h3{font-family:var(--font-display)}

.landing-top{border-bottom:1px solid var(--line)}
.landing-top .landing-row{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:84px}
.landing-top-actions{display:flex;align-items:center;gap:12px;min-width:0}
.landing-signin{min-height:44px;padding:10px 22px}

/* Page language: globe, code and arrow; the real select lies on top, so a tap opens the system list of 24 languages. */
.landing-language{position:relative;display:inline-flex;align-items:center;gap:8px;min-height:44px;min-width:44px;padding:0 10px;border-radius:var(--radius-button);color:var(--text);font:600 14px/1 var(--font-text);cursor:pointer}
.landing-language svg{display:block;width:20px;height:20px;flex:none}
.landing-language .landing-chevron{width:16px;height:16px;color:var(--muted)}
.landing-language select{position:absolute;top:0;right:0;bottom:0;left:0;inset:0;width:100%;height:100%;min-height:0;margin:0;padding:0;border:0;opacity:0;font-size:16px;cursor:pointer}
.landing-language:hover{background:var(--surface)}
.landing-language:focus-within{outline:2px solid var(--muted);outline-offset:2px}
/* In the top row the picker gives way to the logo and "Войти" (long in some languages, «Aanmelden»): it shrinks first
   (the button wraps its words only after that), and what no longer fits, the arrow and then the code, wraps onto a
   second line that is cut off; the globe always stays. */
.landing-top .landing-language{flex-shrink:100;flex-wrap:wrap;justify-content:center;height:44px;overflow:hidden;row-gap:0}
.landing-top .landing-language>svg{height:44px}
.landing-top .landing-language-code{line-height:44px;white-space:nowrap}

/* Hero: title and form on the left, the demo window on the right; on a phone title, demo, form. */
.landing-hero{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-areas:"text demo" "form demo";column-gap:clamp(32px,4vw,56px);row-gap:28px;align-items:start;padding-block:clamp(40px,5vw,64px)}
.landing-hero-text{grid-area:text;min-width:0}
.landing-hero h1{margin:0;font-size:clamp(40px,5vw,72px);font-weight:800;line-height:1.04;letter-spacing:-.035em;overflow-wrap:break-word;text-wrap:balance}
.landing-intro{margin:16px 0 0;color:var(--muted);font-size:clamp(17px,1.5vw,21px);line-height:1.4}
.landing-hero-form{grid-area:form;display:grid;gap:22px;max-width:440px;min-width:0}
.landing-learn{gap:8px;font-size:14px}
.landing-learn .select{font-size:16px}
.landing-try{display:flex;align-items:center;flex-wrap:wrap;gap:12px 24px}
.landing-try .btn{min-width:min(100%,250px)}
.landing-try-note{color:var(--muted);font-size:14px}

/* Demo window: the pair, the word with its red letter on the axis, pause and the speed. */
.landing-demo{grid-area:demo;display:flex;flex-direction:column;min-width:0;min-height:clamp(320px,30vw,420px);padding:24px 28px;border:1px solid var(--line);border-radius:var(--radius-surface);background:var(--surface)}
.landing-pair{margin:0;color:var(--muted);font-size:15px;overflow-wrap:anywhere}
.landing-stage{position:relative;flex:1 1 auto;min-height:140px;overflow:hidden}
.landing-word{position:absolute;left:50%;top:50%;width:0;height:0;white-space:nowrap;color:var(--text);font:800 clamp(64px,8vw,124px)/1 var(--font-display);letter-spacing:-.03em}
.landing-word .orp{color:var(--red)}
.landing-tick{position:absolute;left:0;width:.4em;height:max(3px,.035em);border-radius:2px;background:var(--red);transform:translateX(-50%)}
.landing-tick.top{top:-.74em}.landing-tick.bottom{top:.66em}
.landing-demo-controls{display:flex;align-items:center;justify-content:center;gap:16px;min-height:48px}
.landing-toggle{display:grid;place-items:center;width:48px;height:48px;padding:0;border:1px solid var(--line);border-radius:50%;background:var(--field);color:var(--text)}
.landing-toggle:hover{border-color:var(--muted)}
.landing-toggle svg{display:block;width:20px;height:20px}
.landing-demo-speed{color:var(--muted);font-size:15px}

/* Three ways: a title, a small live demo and a line of text each. */
.landing-features,.landing-steps{padding-block:clamp(32px,4vw,48px)}
.landing-features>h2,.landing-steps>h2{margin:0 0 28px;font-size:clamp(24px,2.4vw,32px)}
.landing-main>section+section{border-top:1px solid var(--line)}
.landing-feature-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}
.landing-feature{display:grid;grid-template-rows:auto auto 1fr;gap:14px;min-width:0;padding:0 28px;border-left:1px solid var(--line)}
.landing-feature:first-child{padding-left:0;border-left:0}.landing-feature:last-child{padding-right:0}
.landing-feature h3{margin:0;font-size:19px;font-weight:600;overflow-wrap:break-word}
.landing-feature p{margin:0;color:var(--muted);font-size:15px;overflow-wrap:break-word}
.landing-mini{position:relative;display:flex;flex-direction:column;justify-content:center;min-width:0;height:210px;padding:16px;border:1px solid var(--line);border-radius:var(--radius-surface);background:var(--surface);overflow:hidden}
.landing-stage-mini .landing-word{font-size:clamp(40px,4.4vw,60px)}
.landing-note-icon{position:absolute;top:16px;left:16px;width:22px;height:22px;color:var(--muted)}
.landing-mini-reading{justify-content:flex-start}
.landing-reading-line{margin:0;color:var(--muted);font-size:13px;line-height:1.5}
.landing-reading-line .now{color:var(--text)}
.landing-mini-reading .landing-stage{min-height:90px}

/* Card: the word of the learning language, its sound (only when the language has recordings), transcription and
   translation. The sound player markup is WordBeatPronunciation's; here it is drawn small. */
.landing-mini-card{gap:6px}
.landing-card-word{min-width:0}
.landing-mini-card .wk-pronunciation{display:grid;gap:2px;min-width:0}
.landing-mini-card .wk-word-line{display:flex;align-items:center;justify-content:center;gap:6px;min-width:0}
.landing-mini-card .wk-word{min-width:0;margin:0;color:var(--text);font:700 clamp(28px,3vw,40px)/1.15 var(--font-display);letter-spacing:-.02em;white-space:nowrap}
.landing-mini-card .wk-word.wk-word-wrap{white-space:normal;overflow-wrap:anywhere}
.landing-mini-card .wk-audio-cluster,.landing-mini-card .wk-slow-cluster{display:flex;align-items:center;flex:none}
.landing-mini-card .wk-audio-label,.landing-mini-card .wk-audio-status{display:none}
.landing-mini-card .wk-audio-button{display:grid;place-items:center;width:44px;height:44px;padding:0;border:0;border-radius:50%;background:transparent;color:var(--red);cursor:pointer}
.landing-mini-card .wk-slow-button{color:var(--muted)}
.landing-mini-card .wk-audio-button svg{display:block;width:24px;height:24px}
.landing-mini-card .wk-audio-button:hover,.landing-mini-card .wk-audio-button[aria-pressed=true]{background:var(--field)}
.landing-mini-card .wk-audio-button:disabled{opacity:.4;cursor:default}
.landing-mini-card .wk-phonetics-line{display:flex;align-items:center;justify-content:center;gap:4px;min-height:44px;min-width:0}
.landing-mini-card .wk-ipa{min-width:0;color:var(--muted);font-size:16px;overflow-wrap:anywhere}
.landing-mini-card .wk-ipa:empty{display:none}
.landing-mini-card.no-audio .wk-audio-cluster,.landing-mini-card.no-audio .wk-slow-cluster{display:none}
.landing-card-answer{display:grid;grid-template-columns:minmax(0,1fr);min-height:44px}
/* A long word («թարգմանությունը») breaks inside the button rather than pushing it out of the card. */
.landing-reveal{min-width:0;min-height:44px;width:100%;padding:8px;font-size:13px;font-weight:500;overflow-wrap:break-word}
@media(max-width:360px){.landing-reveal{padding:6px;font-size:11px}}
.landing-translation{display:grid;place-items:center;min-height:44px;color:var(--text);font:600 18px/1.2 var(--font-display);overflow-wrap:anywhere;text-align:center}

/* Three steps joined by a line. */
.landing-step-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:24px;margin:0;padding:0;list-style:none}
.landing-step-list li{position:relative;display:grid;justify-items:center;align-content:start;gap:14px;min-width:0;text-align:center}
.landing-step-list li:not(:last-child)::after{content:"";position:absolute;top:26px;left:calc(50% + 38px);width:calc(100% - 52px);height:1px;background:var(--line)}
.landing-step-number{display:grid;place-items:center;width:52px;height:52px;border:1px solid var(--muted);border-radius:50%;font:600 16px/1 var(--font-display)}
.landing-step-text{display:grid;gap:6px;min-width:0}
.landing-step-text strong{font:700 17px/1.3 var(--font-display)}
.landing-step-text span{color:var(--muted);font-size:14px}

/* Call: the mark on the line, the title and "Попробовать" once more. */
.landing-cta{position:relative;display:grid;justify-items:center;gap:22px;padding-block:52px 60px;text-align:center}
.landing-cta-mark{position:absolute;top:0;left:50%;display:flex;align-items:center;gap:10px;padding:0 12px;background:var(--bg);transform:translate(-50%,-50%)}
.landing-cta-mark i{display:block;width:24px;height:2px;border-radius:2px;background:var(--red)}
.landing-cta-mark svg{display:block;width:24px;height:27px;color:var(--red)}
.landing-cta h2{margin:0;font-size:clamp(30px,3.6vw,46px);font-weight:800;letter-spacing:-.03em}
.landing-cta .landing-try{justify-content:center}

.landing-footer{border-top:1px solid var(--line)}
.landing-footer .landing-row{display:flex;align-items:center;flex-wrap:wrap;gap:12px 24px;min-height:84px;padding-block:16px}
.landing-footer .logo{font-size:22px}
.landing-domain{padding-left:24px;border-left:1px solid var(--line);color:var(--muted);font-size:14px}
.landing-language-bottom{margin-left:auto}

@media(max-width:760px){
  .landing{--gutter:20px}
  .landing-top .landing-row{min-height:68px}
  .landing-top-actions{gap:4px}
  .landing-signin{padding:10px 16px}
  .landing-hero{grid-template-columns:minmax(0,1fr);grid-template-areas:"text" "demo" "form";row-gap:18px;padding-block:22px 36px}
  .landing-hero h1{font-size:clamp(31px,10vw,42px)}
  .landing-intro{margin-top:10px;font-size:16px}
  .landing-demo{min-height:0;height:226px;padding:14px 16px}
  .landing-demo .landing-word{font-size:clamp(50px,16vw,72px)}
  .landing-hero-form{max-width:none;gap:14px}
  .landing-try{flex-direction:column;align-items:stretch;gap:10px;text-align:center}
  .landing-try .btn{width:100%;min-width:0}
  .landing-features>h2,.landing-steps>h2{margin-bottom:18px;font-size:23px}
  .landing-feature-grid{grid-template-columns:minmax(0,1fr);gap:14px}
  /* Demo on the left, title and text on the right; the text column is never narrower than its longest word
     («Запам’ятовування», «Nopeuslukeminen»), the demo takes the rest. */
  .landing-feature{grid-template-columns:minmax(0,1.15fr) minmax(min-content,1fr);grid-template-rows:auto 1fr;grid-template-areas:"demo title" "demo text";column-gap:16px;row-gap:6px;align-items:start;padding:0;border:0}
  .landing-feature h3{grid-area:title;margin-top:10px;font-size:17px}
  .landing-feature p{grid-area:text;font-size:14px}
  .landing-mini{grid-area:demo;height:auto;min-height:150px;padding:12px}
  .landing-stage-mini .landing-word{font-size:clamp(28px,9vw,40px)}
  .landing-note-icon{top:10px;left:10px;width:18px;height:18px}
  .landing-mini-card .wk-word{font-size:clamp(22px,7vw,30px)}
  .landing-mini-card .wk-ipa{font-size:14px}
  .landing-step-list{grid-template-columns:minmax(0,1fr);gap:18px}
  .landing-step-list li{grid-template-columns:44px minmax(0,1fr);justify-items:start;align-items:center;gap:16px;text-align:left}
  .landing-step-list li:not(:last-child)::after{top:44px;left:22px;width:1px;height:18px}
  .landing-step-number{width:44px;height:44px;font-size:14px}
  .landing-cta{gap:16px;padding-block:40px 44px}
  .landing-footer .landing-row{gap:10px 16px;min-height:68px}
  .landing-footer .logo{font-size:20px}
  .landing-domain{padding-left:16px}
}
/* Narrow phones: the logo, the language picker and "Войти" share one row in every language. */
@media(max-width:420px){
  .landing-top .landing-row{gap:8px}
  .landing-signin{padding:10px 12px}
}
@media(max-width:380px){.landing-top .logo{font-size:20px}}

/* ---------- Sign-in window ---------- */
.auth-signin{--gutter:max(20px,min(5.5vw,80px));min-height:100vh;min-height:100dvh;display:flex;flex-direction:column}
.signin-top{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:84px;padding-inline:var(--gutter)}
.signin-language{min-width:0;font-weight:500}
.signin-language-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.signin-body{flex:1;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:center;gap:48px;width:100%;max-width:calc(1280px + 2 * var(--gutter));margin:0 auto;padding:24px var(--gutter) 72px}
.signin-demo{display:flex;flex-direction:column;align-items:center;gap:14px;min-width:0}
.signin-demo .landing-pair{font-size:14px}
.landing-stage-signin{flex:none;width:min(100%,380px);height:280px}
.landing-stage-signin::before{content:"";position:absolute;left:50%;top:0;bottom:0;width:1px;background:var(--line)}
.landing-stage-signin .landing-word{font:500 60px/1 Arial,sans-serif;letter-spacing:-.02em}
.landing-stage-signin .landing-tick{width:.45em;height:3px}
.landing-stage-signin .landing-tick.top{top:-1.65em}.landing-stage-signin .landing-tick.bottom{top:1.6em}
.signin-panel{width:100%;max-width:440px;min-width:0}
.signin-back{min-height:44px;margin:0 0 14px -8px;padding:8px}
.signin-back svg{display:block;width:18px;height:18px}
.signin-panel h1{font-size:clamp(27px,2.4vw,34px);overflow-wrap:break-word}
@media(max-width:360px){.signin-panel h1{font-size:22px}.signin-language-name{display:none}}
.signin-note{margin:10px 0 0;color:var(--muted);font-size:14px}
#authGuest{margin-top:28px}
.signin-submit{width:100%;margin-top:20px}
.signin-submit[aria-busy=true]{opacity:1;cursor:wait}
.signin-submit .status-spinner{display:block;width:18px;height:18px}
.signin-error{margin:10px 0 0;color:var(--red);font-size:13px}
.signin-email{display:inline-flex;align-items:center;gap:10px;max-width:100%;min-height:44px;padding:0 8px 0 0;border:0;border-radius:var(--radius-button);background:none;color:var(--text);font-size:14px;text-align:left}
.signin-email svg{display:block;width:18px;height:18px;flex:none;color:var(--muted)}
.signin-email span{min-width:0;overflow-wrap:anywhere}
.signin-email:hover .signin-email-edit{color:var(--text)}
.signin-hint{margin:12px 0 0;color:var(--muted);font-size:14px}
/* Six cells drawn under one transparent input: typing, pasting and the phone's autofill all go to that input. */
.code-field{position:relative;display:block;margin-top:16px}
.code-cells{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:12px}
.code-cell{display:grid;place-items:center;height:62px;border:1px solid var(--line);border-radius:var(--radius-field);background:var(--field);color:var(--text);font:600 26px/1 var(--font-display)}
.code-cell:empty::before{content:"";width:4px;height:4px;border-radius:50%;background:var(--muted)}
.code-field:focus-within .code-cell.current{border-color:var(--text)}
.code-field.invalid .code-cell{border-color:var(--red)}
.code-input{position:absolute;top:0;right:0;bottom:0;left:0;inset:0;width:100%;height:100%;margin:0;padding:0;border:0;outline:0;background:transparent;color:transparent;-webkit-text-fill-color:transparent;caret-color:transparent;font-size:16px;cursor:text}
.code-input::selection{background:transparent}
.signin-resend{min-height:44px;margin-top:12px;padding-inline:0;color:var(--muted);font-weight:500}
.signin-unavailable{display:grid;gap:4px;margin-top:24px;padding:16px 18px;border:1px solid var(--line);border-radius:var(--radius-surface);background:var(--surface)}
.signin-unavailable strong{font:600 15px/1.3 var(--font-display)}
.signin-unavailable p{margin:0;color:var(--muted);font-size:14px}
.signin-retry{margin-top:16px}

@media(max-width:760px){
  .auth-signin{--gutter:20px}
  .signin-top{min-height:68px}
  .signin-body{grid-template-columns:minmax(0,1fr);align-items:start;align-content:start;gap:8px;padding-top:0;padding-bottom:40px}
  .landing-stage-signin{height:160px}
  .landing-stage-signin .landing-word{font-size:52px}
  .landing-stage-signin .landing-tick.top{top:-1.25em}.landing-stage-signin .landing-tick.bottom{top:1.2em}
  .signin-panel{max-width:none}
  #authGuest{margin-top:22px}
  .code-cells{gap:8px}
  .code-cell{height:52px;font-size:22px}
}
@media(max-width:360px){
  .landing,.auth-signin{--gutter:16px}
  .landing .logo,.auth-signin .logo{font-size:20px}
  .landing-top .logo{font-size:18px}
  .landing-top .landing-language{column-gap:4px;padding:0 6px}
  .landing-top .landing-chevron{display:none}
  .landing-signin{padding:10px 8px}
}
/* The title of a way above its demo and text: here the text column cannot hold the longest titles beside a demo
   that still shows its word on one line. */
@media(max-width:374px){
  .landing-feature{grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);grid-template-areas:"title title" "demo text";row-gap:10px}
  .landing-feature h3{margin-top:0}
}
@media(max-height:520px) and (orientation:landscape){.landing-stage-signin{height:120px}.landing-stage-signin .landing-word{font-size:44px}.signin-body{align-items:start}}
/* The view for a TV: the page language (an invisible select over the globe) and the six code cells (one transparent
   field over them) show the red frame of the remote (wordbeat.css) on what can be seen. */
html.tv-mode .landing-language:focus-within{outline:var(--remote-frame);outline-offset:var(--remote-frame-gap)}
html.tv-mode .code-field:focus-within{outline:var(--remote-frame);outline-offset:var(--remote-frame-gap);border-radius:var(--radius-field)}
html.tv-mode body .code-field .code-input:focus{outline:none}
