/* mypoliglota.app — in the style of metaes.io: one narrow column, plain type, thin headings
   with a gradient, quiet links. */
:root {
  --text: #555;
  --muted: #666;
  --rule: #ccc;
  --link: #2f6a99;
  --background: #fff;
  --gradient: linear-gradient(90deg, #022640, #5786ab);
  --page: #fdfcf9;
  --page-text: #222;
  --highlight: rgb(255 214 10 / 55%);
  --blade-top: rgb(235 235 235 / 75%);
  --blade-middle: rgb(142 142 147 / 55%);
  --blade-bottom: rgb(142 142 147 / 70%);
  --blade-seam: rgb(255 255 255 / 50%);
  --screen: linear-gradient(180deg, #c3dcfb 0%, #dcdcf8 55%, #f1e9f8 100%);
  --card: rgb(255 255 255 / 62%);
  --card-edge: rgb(255 255 255 / 85%);
  --card-text: #111;
  --card-blue: #007aff;
  --know: #28a745;
  --dont-know: #f08a00;
}
@media (prefers-color-scheme: dark) {
  :root {
    --text: #c9cbd1;
    --muted: #9a9ca3;
    --rule: #333;
    --link: #7fb2dd;
    --background: #14151a;
    --gradient: linear-gradient(90deg, #7ec8e3, #b8dff0);
    --page: #1c1d22;
    --page-text: #d8d9de;
    --highlight: rgb(255 214 10 / 40%);
    --blade-top: rgb(56 56 56 / 85%);
    --blade-middle: rgb(20 20 20 / 90%);
    --blade-bottom: rgb(10 10 10 / 94%);
    --blade-seam: rgb(255 255 255 / 12%);
    --screen: linear-gradient(180deg, #1b2540 0%, #221f38 55%, #2a1f33 100%);
    --card: rgb(40 42 52 / 70%);
    --card-edge: rgb(255 255 255 / 14%);
    --card-text: #f2f2f5;
    --card-blue: rgb(158 219 255);
    --know: #30d158;
    --dont-know: #ff9f0a;
  }
}
html { background: var(--background); }
body {
  margin: 0;
  padding: 4em 1em 0;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 1em;
  line-height: 1.5;
  color: var(--text);
}
.container { max-width: 980px; margin: 0 auto; padding: 0 15px; }
.nav {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 20px;
  padding: 0;
  margin: 0;
  list-style-type: none;
}
.nav a { color: var(--muted); font-size: .9em; text-decoration: none; }
.nav a[aria-current] { color: var(--text); }
/* As wide as the column, the languages pushed to its right end. */
header { width: 100%; padding-bottom: 10px; margin-bottom: 2.5em; border-bottom: 1px solid var(--rule); }
header .nav { width: 100%; }
/* The languages in the pages' own row, pushed to its right end: one baseline for all. */
.languages { margin-left: auto; font-size: .9em; color: var(--muted); white-space: nowrap; }
.languages a { color: var(--muted); text-decoration: none; }
.languages a[aria-current] { color: var(--text); font-weight: 700; }
.home-link { font-size: 1.3em; font-weight: 700; }
.home-link a { color: var(--text); font-size: 1em; }
h1, h2 {
  color: transparent;
  -webkit-text-fill-color: transparent;
  background-image: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
}
/* The app's icon above the title, rounded as on the home screen, centred with the title and its line. */
.hero { text-align: center; }
.logo { display: block; margin-left: auto; margin-right: auto; width: 180px; height: 180px; margin-top: 1em; border-radius: 22.5%; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
@media (max-width: 600px) { .logo { width: 128px; height: 128px; } }

h1 { margin-top: 15px; margin-bottom: 0; font-size: 50px; font-weight: 100; line-height: 1.15; }
h2 { margin-top: 1.25em; margin-bottom: .5em; padding-top: 0; font-weight: 400; }
h1 + h2 { margin-top: .75em; padding-top: 0; }
p, li { font-size: 16px; }

/* The language in the title's line, said in one language after another: each blurs away as the
   next comes in. All in one cell, as wide as the widest. */
/* A fading word can't share its line's gradient, so each part of the line carries its own. */
.said { background-image: none; }
.said > span:not(.cycle), .cycle > span {
  background-image: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
}
.cycle { display: inline-grid; vertical-align: bottom; }
.cycle > span {
  grid-area: 1 / 1;
  opacity: 0;
  animation: cycle 15s infinite;
  animation-delay: calc(var(--i) * 3s - 15s);
}
@keyframes cycle {
  0%, 17% { opacity: 1; filter: blur(0); }
  20%, 97% { opacity: 0; filter: blur(6px); }
  100% { opacity: 1; filter: blur(0); }
}
@media (prefers-reduced-motion: reduce) {
  .cycle > span { animation: none; }
  .cycle > span:first-child { opacity: 1; }
}

/* A passage of a text as the app shows it: the page, one word lit yellow, the aperture's blades
   round it. */
.passage {
  position: relative;
  overflow: hidden;
  margin: 2em 0;
  padding: 2em;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: var(--page);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15em;
  line-height: 1.7;
  color: var(--page-text);
}
.passage p { margin: 0; font-size: inherit; }
.passage cite { display: block; margin-top: 1em; font-family: Helvetica, Arial, sans-serif; font-size: .7em; font-style: normal; color: var(--muted); }
.passage .blades { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.passage .blades path { fill: url(#blade-sheen); stroke: var(--blade-seam); stroke-width: .75; }
.passage .word { position: relative; z-index: 1; border-radius: 4px; transition: background-color .3s ease; }
.passage .word.lit { background-color: var(--highlight); }
@media (prefers-reduced-motion: reduce) {
  .passage .word { transition: none; }
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
.updated { color: var(--muted); font-size: .9em; }
.aside {
  margin: 1em 0;
  padding-left: 1em;
  border-left: 2px solid #5786ab;
  font-size: 1.25em;
  font-style: italic;
  color: var(--text);
}
hr { max-width: 980px; margin: 20px auto; border: none; border-top: 1px solid var(--rule); background: none; }
footer { max-width: 980px; margin: 20px auto; text-align: center; font-size: .8em; color: var(--muted); }
@media (max-width: 600px) {
  h1 { font-size: 38px; }
  body { padding-top: 2em; }
}

/* A flashcard session in a drawing of an iPhone, its screen laid out in the largest iPhone's
   points and scaled down with the drawing: small enough to use on a phone's page too. The deck's
   colour behind, the card in glass, the two answers at the bottom. It answers itself every few
   seconds; answered by hand, it waits a while before going on. */
.session {
  container-type: inline-size;
  width: min(300px, 76vw);
  aspect-ratio: 440 / 956;
  margin: 2.5em auto;
  padding: 1.4%;
  box-sizing: border-box;
  border-radius: 14% / 6.5%;
  background: #1c1c1e;
  box-shadow: inset 0 0 0 1px #4a4a4e, 0 18px 40px rgb(0 0 0 / 22%);
}
.screen {
  /* One point of the largest iPhone's screen. */
  --pt: calc(100cqw / 440);
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: calc(var(--pt) * 130) calc(var(--pt) * 16) calc(var(--pt) * 34);
  box-sizing: border-box;
  border-radius: calc(var(--pt) * 62);
  overflow: hidden;
  background: var(--screen);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", Helvetica, Arial, sans-serif;
  color: var(--card-text);
  text-align: left;
}
.screen-time {
  position: absolute;
  top: calc(var(--pt) * 20);
  left: calc(var(--pt) * 52);
  font-size: calc(var(--pt) * 17);
  font-weight: 600;
}
.island {
  position: absolute;
  top: calc(var(--pt) * 14);
  left: 50%;
  width: calc(var(--pt) * 126);
  height: calc(var(--pt) * 37);
  translate: -50% 0;
  border-radius: 999px;
  background: #000;
}
.session-cards { display: grid; flex: 1; align-content: center; }
.card {
  grid-area: 1 / 1;
  padding: calc(var(--pt) * 30) calc(var(--pt) * 26);
  border: 1px solid var(--card-edge);
  border-radius: calc(var(--pt) * 34);
  background: var(--card);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  backdrop-filter: blur(20px) saturate(1.4);
  box-shadow: 0 calc(var(--pt) * 10) calc(var(--pt) * 30) rgb(40 60 120 / 14%);
}
/* The word and its translation: out quickly, in a moment later, as in the app. */
.card { position: relative; }
.card-head { display: flex; flex-direction: column; gap: calc(var(--pt) * 10); }
.card-head.gliding { transition: height .22s ease-in-out; }
.card-head .card-word, .card-head .card-translation-text { transition: opacity .16s ease-out .08s; }
.card-head .arriving { opacity: 0; transition: none; }
.card-head-ghost { position: absolute; margin: 0; pointer-events: none; transition: opacity .1s ease-in; }
.card-head-ghost.leaving { opacity: 0; }
.card-language { transition: transform .22s ease-in-out; }
/* The sentences slide as a whole in a window cut to the one shown. */
.card-examples { margin-top: calc(var(--pt) * 22); overflow: hidden; }
.card-examples.sliding { transition: height .22s ease-in-out; }
.card-examples.sliding .card-strip { transition: transform .22s ease-in-out; }
.card-strip { display: flex; flex-direction: column; gap: calc(var(--pt) * 24); }
.card-example { display: flex; flex-direction: column; gap: calc(var(--pt) * 6); }
.card-word { margin: 0; text-align: center; font-size: calc(var(--pt) * 34); font-weight: 600; line-height: 1.15; overflow-wrap: anywhere; }
.card-flag { margin-right: .2em; font-size: .85em; }
.card-translation {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: calc(var(--pt) * 10);
  margin: 0;
  font-size: calc(var(--pt) * 24);
  font-weight: 600;
  color: var(--card-blue);
}
.card-language {
  padding: calc(var(--pt) * 2) calc(var(--pt) * 10);
  border: 1px solid var(--card-edge);
  border-radius: 999px;
  background: var(--card);
  font-size: calc(var(--pt) * 13);
  font-weight: 600;
}
.card-sentence { margin: 0; font-size: calc(var(--pt) * 19); line-height: 1.4; }
.card-sentence b { font-weight: 700; }
.card-page { margin-left: .4em; font-size: .65em; color: var(--muted); }
.card-sentence-translation { margin: 0; font-size: calc(var(--pt) * 18); line-height: 1.4; color: var(--card-blue); }
.session-answers { display: grid; grid-template-columns: 1fr 1fr; gap: calc(var(--pt) * 10); }
.answer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: calc(var(--pt) * 8);
  min-height: calc(var(--pt) * 62);
  padding: 0 calc(var(--pt) * 12);
  border: 1px solid var(--card-edge);
  border-radius: 999px;
  background: var(--card);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  backdrop-filter: blur(20px) saturate(1.4);
  box-shadow: 0 calc(var(--pt) * 4) calc(var(--pt) * 14) rgb(40 60 120 / 10%);
  font: inherit;
  font-size: calc(var(--pt) * 18);
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .15s ease;
}
.answer svg { width: calc(var(--pt) * 26); height: calc(var(--pt) * 26); fill: currentColor; flex: none; }
.answer.know { color: var(--know); }
.answer.dont-know { color: var(--dont-know); }
.answer:active, .answer.pressed { transform: scale(.95); }
.answer:focus-visible { outline: 2px solid var(--card-blue); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .card-head, .card-examples, .card-strip, .card-language, .answer { transition: none; }
}

/* A short note under an illustration, on what it shows in the app. */
.footnote { margin: 0 0 2em; font-size: 13px; line-height: 1.45; color: var(--muted); }
.footnote-centred { max-width: 440px; margin-left: auto; margin-right: auto; text-align: center; }
.passage:has(+ .footnote), .session:has(+ .footnote) { margin-bottom: .75em; }

/* The App Store badge under its heading, Apple's own artwork, not a link until the app is out,
   the note under it. */
.store { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin: 0 0 1em; }
.store img { display: block; width: 160px; height: auto; }
